Category: PHP, javascript

How often have your clients complained to you about not being able to see the new changes you have made to their website? For example, perhaps I’ve just updated the JavaScript and/or CSS files, but my client’s browser is still using their cached version (preventing them from seeing any of the new changes) and they’re confused as to why they’re looking at an older site. The most common way to tackle this issue is to version JavaScript and CSS files.

Happily, there is a way around this that this article will dive into, so without further ado let’s explore two ways to automatically version JavaScript and CSS Files in PHP.

This method is more complex and aims to automatically append the version of each JavaScript and CSS file directly to their name.
Newsletter

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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners