3 ms·
I'm not the author of the post, so I can't tell you what the author does. What I do in my projects is that I tell varnish-cache to cache assets in "/static/...
by acatton 4y ago
I'm not the author of the post, so I can't tell you what the author does.
What I do in my projects is that I tell varnish-cache to cache assets in "/static/..." forever. And I have a "curl -X PURGE <varnish_endpoint>" as part of the "ExecStartPre=" of my go binary.
• https://varnish-cache.org/docs/trunk/users-guide/purging.html#http-purging https://varnish-cache.org/docs/trunk/users-guide/purging.htm...
• https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStartPre= https://www.freedesktop.org/software/systemd/man/systemd.ser...
- ed25519FUUU 4y agoClever solution! Why not make it part of the startup of your binary?
- acatton 4y agoSorry to reply a day later. GP here, it's a simple separation of concern. IMHO the binary should not be aware that it is cached and/or how it's deployed. I separate "business logic" from "devops", and I consider purging the cache to be "devops". This is why I let systemd do it. Of course, at the end it's a question of preference. People might disagree.