lundi 29 juin 2015

Avoid HTML file cache in HTML5 manifest (appcache)

I made a little script in PHP that create a file manifest for my website scanning the directories which I give it but without include in the manifest the HTML pages and the manifest file it cache them anyway. The problem is that many part of HTML pages are dynamical written by PHP and now don't change, they remain static but the more strange things is that when I change language and the website is reloaded the page is correctly translated and the text are also written by PHP. I've seen in a guide for the manifest usage to include in .htaccess this:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/cache-manifest "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds" 
</IfModule>

The mod_expires is active and I seen website HTML index headers:

HTTP/1.1 200 OK => 
Date => Mon, 29 Jun 2015 19:13:02 GMT
Server => Apache/2.4.12 (Ubuntu)
X-Powered-By => PHP/5.6.10-1+deb.sury.org~trusty+1
Vary => Accept-Encoding
Cache-Control => max-age=1
Expires => Mon, 29 Jun 2015 19:13:03 GMT
X-Frame-Options => DENY
Connection => close
Content-Type => text/html; charset=UTF-8

So I think that the .htaccess directive is working but browser ignores it, I've tested on Chrome and Safari and also on Safari for iOS 8 but no changes. With manifest I can get a website that loads in few seconds but now ever works offline. How can I disable HTML and manifest cache? Here there is the website (beta): http://ift.tt/1CF9sdk Here there is the manifest: http://ift.tt/1C2CTLu

Aucun commentaire:

Enregistrer un commentaire