'Cache discriminator viable approach in web pages
In the project i have developed till now, i usually add a random number to each request of data or file related to the project. I have to specify that the projects i am talking about are web application, and cache discriminator is not applied to third party library (eg : angular) but only to my js files and ajax calls.
The idea work fine but i wonder why i can't ask to the servere which is it's version, and use this number as cache discriminator (instead of a random number that will change on each request). I would like to proceed in that way only for the "file discriminator" and not for ajax call discriminator (ajax request should never be cached, file request can be cached if the application does not change).
In that way my custom javascript files can be cached by browser and be valid until i publish a new version. Now i don't know if it's a lack of my knolwedge or what, but i never heard about that tecnique, and i would like to know if there are some loophole i am not seeing (and that's may be why no one adopted this approach).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
