08
Jun
Application Cache In HTML5 Based Zencart Website

Posted On : June 8, 2013
| 1 Comment
Today HTML5 newly leading html version and growing well with Zencart in web development. If you working with HTML5, then take a quick look at this post that explains how to develop a offline web project using HTML5 based Zencart application cache. Most of the latest browsers have caching mechanisms, this gives three advantages reducing server load, increases web page speed and office access specially for gaming and business website.
You have to manage it in Mainfest file
Mainfest file contain mainly three parts
- CACHE MANIFEST
- NETWORK
- FALLBACK
You have to create simple text file using common editor or notepad with extension filename.appcahe
CACHE MAINFEST
List out all the files that you want to be cached under the browser manifest.
e.g index.html , style.css , logo.png …etc
NETWORK
Sometimes webpage need to strongly needed internet access to call APIs, In this case we have to keep resource under this header.
e.g Chrome
NETWORK:
*
Firefox
NETWORK:
http:// * , https:// *
FALLBACK
If you want to display some special no internet page like 404, keep the file or url under this header.
e.g
FALLBACK:
/ no-internet.html
So finally mainfest.appcache will be look like this
CACHE MANIFEST
index.html
style.css
logo.png
FALLBACK:
/ no-internet.html
NETWORK:
*
Note :
Some servers are not supporting .appcache file type extension, include this file for better result in .htaccess
E.g AddType text/cache-manifest .appcache
Now need to add mainfest.appcache index.html
E.g Zencat setup root directory : /includes/templates/template_default/common/html_header.php
<!doctype html>
<html manifest=”mainfest.appcache”>
<head>
…………………………………………………………………
…………………………………………………………………
</head>
<body>
…………………………………………………………………
………………………………………………………………..
</body>
</html>
Application Cache Clear in Chrome
chrome://appcache-internals/
Posts
I like what you guys are upto. This type of clever work and reporting!
Keep up the wonderful works guys I’ve included you guys to our blogroll.
Vivien