javascript - Avoiding conditional request to the server -


I have a JS file loaded in the cache.

When an html file is loaded in the browser, a conditional request (found from) server to check whether the resource has changed or not.

What I have to do, does not send any request to the server (neither conditional request nor fresh request) resource is cached.

Is this possible?

If possible, what are the solutions for this?

If not, why not?

Yes, it is possible to tell the browser that your content will not be changed, so there is no need to request it. is. You should use the maximum-age parameter of the cache-control header or the header must end. This pre-stack overflow discusses the pros and cons of using each.


Comments