Source: barryvanveen.nl

Simple cache busting in Laravel

Category: Laravel, javascript

It is usually a good idea to cache your CSS and JS files as long as possible. But how do you make sure your visitors will download your new files when you made changes to them? Cache busting solves exactly this problem. Cache busting usually involves changing the file name of your assets when you make changes to them. This is done by computing a http://php.net/manual/en/function.hash-file.php on the source and incorporating that into the file name.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners