0

I study JavaScript and Html 5 online and execute the codes I've learned on localhost. Recently I learned manifest attribute in html tag which is a new feature in Html 5. Then I made my own .appcache file and the problem started. Even though I'm connected to internet, the cache that's stored in my computer is being used. Here is the index.php file(But no php in code):

<html manifest="./cevrimdisi.appcache">
<head>
<meta charset="UTF-8">
<title>BAŞLIK</title>
</head>
<body>
<font id="demo">Kutay</font>
<script>
document.getElementById("demo").style.color="blue";

</script>
</body>
</html>

cevrimdisi.appcache:

CACHE MANIFEST
# 09/09/2013

CACHE:
index.php

FALLBACK:
cevrimdisi.html

NETWORK:

*

.htaccess

AddType text/cache-manifest .appcache

1 Answers1

1

The cache will be used even if the browser has internet connection. There's only three ways to update the cache

  1. The user clears their browser's data storage for your site.
  2. The manifest file is modified. Note: updating a file listed in the manifest doesn't mean the browser will re-cache that resource. The manifest file itself must be altered.
  3. The app cache is programatically updated.

More info here

http://www.html5rocks.com/en/tutorials/appcache/beginner/#toc-updating-cache

enriquecastl
  • 840
  • 5
  • 10
  • So how can I make my cache to be available when only the connection to internet is lost? –  Sep 10 '13 at 16:14
  • You can't http://stackoverflow.com/questions/11176910/html5-application-cache-updating-solution This is outside the question's scope but if you're developing using app cache I recommend you: 1. Activate the app cache only in production mode. 2. Every time you create a new production build, try to automate the update of the manifest. 3. You can use grunt-contrib-watch to create a task that update the manifest file every time a file changes in your project – enriquecastl Sep 10 '13 at 16:27