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

Cache static data for a day #1708

Merged
merged 3 commits into from
Jun 29, 2023
Merged

Cache static data for a day #1708

merged 3 commits into from
Jun 29, 2023

Conversation

SleeplessOne1917
Copy link
Member

This sets cache control for static content.

@@ -24,7 +24,7 @@ export async function createSsrHtml(

if (!appleTouchIcon) {
appleTouchIcon = site?.site_view.site.icon
? `data:image/png;base64,${sharp(
? `data:image/png;base64,${await sharp(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice.

if (user.auth()) {
caching = "private";
} else {
caching = "public, max-age=60";
Copy link
Contributor

Choose a reason for hiding this comment

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

Would changing max-age here to 5 fix/mitigate our captcha and logout issues?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. I left a comment on your other PR about the Clear-Site-Data header. That would require a change to the js client instead of the UI, but it could help. The only rub is that the cache option of site data is not supported in Firefox.

@alectrocute
Copy link
Contributor

I say we change the public, max-age to be way less time and ship it. This will solve a lot of issues. We can revisit our cache strategy in the 0.18.2 milestone.

@alectrocute alectrocute self-requested a review June 29, 2023 18:17
@SleeplessOne1917 SleeplessOne1917 merged commit df39e0f into main Jun 29, 2023
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.

3 participants