Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link preloading #336

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Link preloading #336

merged 1 commit into from
Jul 11, 2024

Conversation

timacdonald
Copy link
Member

Using instant.page, we preload any links to the same domain on hover, making the documentation navigation feel blazingly fast,

I've introduced the cache headers public, max-age=300 so that the client's browsers is able to store the HTML responses in its cache, otherwise preloading has no impact.

I figure 10 minutes is a sensible length. If you navigate back to a page you have recently been on you don't need to re-download it.

Worst case scenario: we deploy changes and the client doesn't see them for 10 minutes if they have just downloaded the page.

<x-button.primary class="w-full sm:w-auto pointer-events-auto" href="/docs">
<x-button.primary class="w-full sm:w-auto pointer-events-auto" href="/docs/{{ DEFAULT_VERSION }}">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These link changes just mean that the clients don't have to make 2 requests to get to the docs page, i.e, request to /docs which redirects to /docs/{currentVersion}

@timacdonald timacdonald marked this pull request as ready for review July 11, 2024 00:00
@taylorotwell taylorotwell merged commit 59b7d9f into master Jul 11, 2024
1 check passed
@taylorotwell taylorotwell deleted the preloading branch July 11, 2024 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants