Disable css caching. Improved page caching. Changing request headers

When making changes to websites, we often encounter the fact that the contents of pages, css files and scripts (.js) are cached by the browser and remain unchanged for quite a long time. This leads to the fact that in order for the changes made to be reflected in all browsers, it is necessary to accustom clients to complex combinations of F5 or Ctrl + F5. And from time to time make sure that they are pressed.

The process is quite tedious and inconvenient. You can, of course, get out of the situation by renaming the files each time, but again it’s inconvenient.

However, there is a way that will allow us to remain with the same names and reset the caching of .css or .js files at the moment when we need it. And forget about Ctrl + F5 forever.

The bottom line is that we will attach a pseudo-parameter to our .css or .js files at the end, which we will change from time to time, thereby resetting the cache in the browser.

Thus, the entry in source code will now look like this:

Where 186485 is an arbitrary combination that will output the same file, but the browser interprets it as new, thanks to the pseudo-parameter ?186485

Now, in order not to change all occurrences of our parameter each time, we will set it in a php file, which we will connect to all the places we need:

Bluetooth