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

Suspected Caching on Glycam Actual causing site to break. #202

Open
gitoliver opened this issue Jul 3, 2024 · 2 comments
Open

Suspected Caching on Glycam Actual causing site to break. #202

gitoliver opened this issue Jul 3, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@gitoliver
Copy link
Collaborator

gitoliver commented Jul 3, 2024

When using Brave on actual when I try to build anything it gets stuck trying to load on the options page. I see a 404 error:
https://jam.dev/c/6e917a04-eee1-4bb1-9a18-e01c560784f1
If I try in a private tab or in Firefox actual works fine. I have no idea how often this is occurring for users.

We need to somehow force cache flushes?
https://webmasters.stackexchange.com/a/138269
The relevant part of that answer being:
You should set proper cache control headers so that you don't have this problem again in the future. Rather than making browsers guess how long they can cache pages, you should explicitly tell them.

For a site based on Apache, you can put something like this in your .htaccess file:

Default caching: 1 day

Header set Cache-Control "max-age=84600, public"

Resource caching: 1 week

<FilesMatch ".(ico|jpg|jpeg|png|gif|svg|webp|pdf|js|css)$">
Header set Cache-Control "max-age=592200, public"

That would mean that everybody gets new HTML within 24 hours and changes to images and scripts with in a week. I usually recommend longer cache times for resources because changes to them can be forced by using version parameters on their URLs.

Tool:
glycam.org/txt with DManpa1-OH (or anything)

@gitoliver gitoliver added the bug Something isn't working label Jul 3, 2024
@danwentworthart
Copy link
Contributor

We have been avoiding caching issues in the past by renaming the CSS file. New file name causes it to load. Perhaps this behavior doesn't work in Brave. I will test and see.

I can implement what you shared, but the advantage to the filename edit is that it changes when it needs to, rather than some arbitrary guess at a time span.

If I can preserve the benefits I describe I will, otherwise I can fall back on the advice you shared.

@danwentworthart
Copy link
Contributor

Bringing Andrew into the conversation, because as I looked into this, it seems that my area of the stack is not where caching occurs. Perhaps we can discuss in person at next webdev meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants