Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No caching in HTML5

In HTML4 we used stuff like

    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
    <meta http-equiv="Expires" content="Thu, 01 Jan 1970 00:00:00 GMT" />

to get the browser to not cache the pages.

What should I use in HTML5 to get the browser not to cache my pages. I don't want any pages at all cached.

I've seen something about

    <html manifest="example.appcache">
      ...
    </html>

but it seems like a lot of work to specify all the pages in the whole web application just to get the browser not to cache anything.

Is there a simpler way?

If I omitt the manifest part from the html tag, will that make the browser not cache anything? I.e.

    <html>
      ...
    </html>

Or will it take that as an ok to cache everything?

like image 675
Tika Avatar asked Aug 29 '13 15:08

Tika


1 Answers

Answer#12693786 might be helpful.

Here is an example of your-manifest-file to force updates to all resources.

CACHE MANIFEST
NETWORK:
*

and append manifest attribute to <html> element.

<html manifest="your-manifest-file">

Required for all HTML files you want to disable cache.
Can not be avoided because it is specification of HTML5.

like image 181
hidekuro Avatar answered Oct 18 '22 12:10

hidekuro