javascript - Control browser's caching for link or script with query string -


i'm looking efficient way control browsers cache links (css) , scripts in each page based on file (or module) version. want every browser file's version first (in it's location), if it's still same version, use cache if it's version has been changed, reload file.

if use current file version (or it's module) query string in end of file's location, browser (specially firefox) won't use cache file, it's same previous request , server return 304 header. it's impact loading performance.

for example:

<link rel="stylesheet" type="text/css" media="all" href="modules/footer/view/css/footer.css?version=1.01"> 

i don't want change file's physically location based on it's version because file existed in static location , it's version changed based on update in it's module.

for example:

<link rel="stylesheet" type="text/css" media="all" href="modules/footer/1.01/view/css/footer.css"> 

to:

<link rel="stylesheet" type="text/css" media="all" href="modules/footer/1.02/view/css/footer.css"> 

it worked it's not i'm looking for.


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -