Domanda

I an developing a web app and I want to ensure that the client browser caches the static js and css files and updates it only when files are modified. So if files are modified - one month later - no requests for js and css files would be made for a month. If files are modified within hours, the new files will be requested and delivered. I am wondering if its possible to get the browser to first ask if files have been modified - or any other way maybe?

È stato utile?

Soluzione

You are certainly looking for something like App Cache.

Please check HTML5 Rocks and Mozilla Docs

It's always good to set an expiry date when your HTTP Request is send to cache this files so that going ahead in time the old versions shouldn't be cached. This is the general usecase of highly scalable Modern Full Stack Javascript Application.

Hope that answers your Query.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top