Sunday, 8 July 2012

Google Chrome Application Cache 5MB limit. No More!!!!

There is a grate feature in HTML5 that allows you to cache the content of the web-site locally and use it even if the server is down and there is no internet connection. All you need to do is to defined your manifest file and use the following syntax in HTML code

<html manifest="example.appcache">
Here example.appcache is the name of your manifest. I am not going to explain how do define the manifest or how to use it. There is plenty of blogs, articles about it. Just Google!! (e.g Good Post about caching with HTML5) I am going to explain how to solve a huge problem with this engine on Google Chrome.  Don’t know what guys from Google thought (actually I do Smile ), but they limit the size of the cache to 5MB only. Men!!! If I have 3 pictures on my site, I probably already use at least 1MB on the cache. And any way  - if you use offline manifest at some point you will realize that you need more space. Specially if you are developing mobile application 
    But Google doesn’t provide any configuration or setting to change this limit. Or at least not officially. This is how you can do it not-officially
First of all download some sqlite database client. I usually use Sqlite Administrator
Go to “YOUR USER DOCUEMENTS DIRECTORY”\AppData\Local\Google\Chrome\User Data\Default\Application Cache. For example on my Windows 7 (and yes , it is Legal Smile)
It is C:\Users\mshapira\AppData\Local\Google\Chrome\User Data\Default\Application Cache\index
Open the file “index”
It is a database file. You need to update QUOTE table
By default it has no values. You need to insert 2 values. First one is the web-server that serves the page you want to cache and the second one is the size of the cache. Fill free to set it to some large value
 insert into quota values("http://localhost:80/", 100000000);
You can always view what is the size of your cache by simply typing in Chrome address bar :chrome://appcache-internal

No comments:

Post a Comment