-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add cachebusting for CSS. #20
Conversation
This allows users to set extremely high caching values for their CSS and assets without worrying about poor UX whenever an update to said assets is made. Note: Can't add this for JS assets yet, the cachebusting logic is broken, see getzola/zola#1416 Ref: * https://www.getzola.org/documentation/templates/overview/#get-url * getzola/zola#519
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/ejmg/zerm/3388wxGeTEx5PzjVDtDwdm4CSpkt |
Hmmm, I don't have an account with Vercel, so I can't see what the actual issue is.... Edit: You can find this code running successfully on my own blog: https://austindw.com/ |
Aside: I will have to look into why other people can't see the failed builds, wonder if I can make them public, etc. here's the error log:
off the top of my head, i can't say why it's choking on the |
before going too deep, i have a suspicion this might be just a CI issue. the package.json uses Zola |
Yeah I’ve been using this with no issues on my current blog, using Zola 0.13. I’ve not tested it with the new 0.14 release just yet. |
Cool, this almost certainly means the failure is the vercel deployment
using an old Zola binary.
…On Tue, Jul 20, 2021 at 2:32 PM Austin Dworaczyk Wiltshire < ***@***.***> wrote:
Yeah I’ve been using this with no issues on my current blog, using Zola
0.13.
I’ve not tested it with the new 0.14 release just yet.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#20 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEK7ZPXMLUWGJ643HK6SQU3TYXFLZANCNFSM4ZQCGQEQ>
.
|
alright, i've tested this out myself and it works just fine. i went ahead and updated zerm to use v0.13.0 of zola, too. is there anything that someone using this theme should know about this feature? looking at the zola link, i don't get much about how the caching works or how it effects me, new changes/deployments, etc. other than that, i am good to merge the change. |
Sorry for the delay, been busy. This specifically adds cachebusting, which allows users to safely set really high caching values for static assets (like CSS) while still allowing for updates to the CSS file. This is done by creating a hash of the CSS file contents and appending it to the URL. Whenever the CSS changes, the hash changes, which signals to the browser that a newer version of the CSS is available. It's a way of "having our cake and eating it too." Visitors can benefit from long caching values, while website owners can make CSS changes and know that they'll be propagated immediately to visitors. So for Zerm, this allows users to immediately benefit from changes made inside the theme, without having to wait for visitor's browser caches to expire. |
Thank you for the explanation! |
This allows users to set extremely high caching values for their CSS
assets without worrying about poor UX whenever an update to said
assets is made.
Note: Can't add this for JS assets yet, the cachebusting logic is
broken, see getzola/zola#1416
Ref: