I want to use fingerprint (GitHub - bvdputte/kirby-fingerprint: Cache-busting utility to fingerprint assets (JS/CSS) in Kirby CMS ) with valet ( Laravel Valet - Laravel 8.x - The PHP Framework For Web Artisans ). I can’t get it to work.
sudo nano /usr/local/etc/nginx/valet/valet.conf
Added the ngnix rules
Saved and restarted Valet
valet restart
and i have tried to added a custom config file
cd /Users/macbook/Documents/kirby3-dev
valet secure
cd /Users/macbook/.config/valet/Nginx
ls
kirby3-dev.test
sudo nano kirby3-dev.test
Saved and restarted Valet
valet restart
Maybe @sebastiangreger or @bnomei can help with this as there was already an issue for this the contributed to fix: https://github.com/bvdputte/kirby-fingerprint/issues/9
Hmm. We did indeed manage to get kirby-fingerprint to work on an Nginx server with the described change to the regex, but that was in production, not Valet. Sorry.
Thanks for the insights. Maybe other seasoned Valet users will have a solution.
Fingerprinting or cache-busting files solve a production problem. It ensures browsers will always fetch the most recent asset files instead of using the one it has cached. That’s useful because you don’t have control over your user’s browser.
I use Valet with Kirby since it was released and always deactivate cache-busting in my local config file. Most of the time I work with Dev Tools open (which disables cache) or hard refresh the browser with CMD + R
. That’s my recommendation for you.
If you really want to go that route you can always copy the Kirby driver, change it to support cache-busting, and add it as a local driver to your projects root.
4 Likes
Totally agree with @pedroborges here.
@pedroborges I understand that for some developers hard refresh is a solution for production.
I love to have a develop environment that comes close to production environment. If there is a simple solution for using the same plugin on a develop environment, why not? The solution from @bvdputte for using a parameter instead of a hashed filename works great.
The build process for generating the final css is done with Kirby. With a panel hook or a route i’m looping through all the pages to see which section, modules and pages are used and what kind of navigation is active… without Fingerprinting or cache-busting i always needed to do a hard refresh to see the result.