-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Document HTTP cache config #2593
Conversation
@jmooring could I borrow your eyes for a moment. doc: https://deploy-preview-2593--gohugoio.netlify.app/getting-started/configuration/#configure-http-cache There are some test failures, but other than that this works pretty good in my tests, but I'm struggling with deciding what the config defaults should be. People use Also note that not every HTTP server out there implements the HTTP spec properly (Netlify is doing a poor job, see https://answers.netlify.com/t/server-sometimes-responds-with-http-200-even-when-if-none-match-matches-etag/37852/33?u=bep). [HTTPCache]
[HTTPCache.cache]
[HTTPCache.cache.for]
excludes = ['**{.jpg,.jpeg,.png,.webp,.gif,.ttf}']
includes = ['**']
[[HTTPCache.polls]]
disable = true
high = '0s'
low = '0s'
[HTTPCache.polls.for]
includes = ['**{.jpg,.jpeg,.png,.webp,.gif,.ttf}', 'https://*.{twitter,x,facebook,instagram}.com/**']
[[HTTPCache.polls]]
disable = false
high = '30m0s'
low = '10m0s'
[HTTPCache.polls.for]
includes = ['https://*.{github}.com/**']
[[HTTPCache.polls]]
disable = false
high = '30s'
low = '1s'
[HTTPCache.polls.for]
includes = ['**'] |
@bep You've obviously given this almost infinitely more thought than I have, but I think disabling by default would be safer. Reasoning:
|
I also think we need to craft a example that users can easily replicate to demonstrate the power of this feature, and why in some cases it's better than setting a unique cache expiration for each This might be best in a tips and tricks article... not sure. |
Agree. That was my conclusion as well, I guess.
Well, there's 2 aspects of this new feature:
Obviously 2) works better with HTTP servers with sensible HTTP cache implementations (avoid having to download 50mb JSON files if nothing changed), but it would work fine with the |
465a4d7
to
6bb7615
Compare
OK, I will merge this PR as part of 0.127.0, should be OK. I will write some technical notes here if someone wants to elaborate:
|
No description provided.