Page 1 of 1
Don't allow webbrowser to cache your website - heres how
Posted: Tue Jan 17, 2012 4:58 am
by smashapps
Don't you hate it when you make an update on your website and because web browsers cache websites/web pages users who go on your website will not see the updates?
In the <head> of your HTML file you can add this code:
Code: Select all<meta http-equiv="pragma" content="no-cache">
That will tell the browser to not cache your website, every time you make an update to your website/web page the user who visits the website will see it because they won't see cached web pages

Re: Don't allow webbrowser to cache your website - heres how
Posted: Tue Jan 17, 2012 7:06 am
by Codex
Great snippet, but for those who don't know, this will make page loading slower.
Re: Don't allow webbrowser to cache your website - heres how
Posted: Tue Jan 17, 2012 7:45 am
by smashapps
Yes it will but if you have a website that is updated alot and you need the pages to be loaded again and not from cache then this is how its done
Re: Don't allow webbrowser to cache your website - heres how
Posted: Sat Jan 21, 2012 5:15 pm
by mikethedj4
If you want to cashe certain images, files, etc:
Replace your beginning html tag with this...
Code: Select all<html lang="en" manifest="offline.manifest">
Now make sure you make a file called "offline.manifest" (without quotes) in the same directory/folder your index.html file is located.
Inside the offline.manifest file you'd add the following (replace my file names with the ones you want to cashe)
Code: Select allCACHE MANIFEST
index.html
abstract.css
grayscale.css
images/mikebg.png
images/abstractbg.png
images/chrome.png
images/android.png
images/teambg.png
images/chrome-bg.png
images/cloud.png
images/firefox.png
images/safari.png
images/ie9.png
images/ipad.png
images/lin.png
images/mac.png
images/opera.png
images/win.png
images/dot-tk.gif
images/swagbucks.jpg
Re: Don't allow webbrowser to cache your website - heres how
Posted: Sun Feb 12, 2012 7:20 pm
by zachman61
mikethedj4 wrote:If you want to cashe certain images, files, etc:
Replace your beginning html tag with this...
Code: Select all<html lang="en" manifest="offline.manifest">
Now make sure you make a file called "offline.manifest" (without quotes) in the same directory/folder your index.html file is located.
Inside the offline.manifest file you'd add the following (replace my file names with the ones you want to cashe)
Code: Select allCACHE MANIFEST
index.html
abstract.css
grayscale.css
images/mikebg.png
images/abstractbg.png
images/chrome.png
images/android.png
images/teambg.png
images/chrome-bg.png
images/cloud.png
images/firefox.png
images/safari.png
images/ie9.png
images/ipad.png
images/lin.png
images/mac.png
images/opera.png
images/win.png
images/dot-tk.gif
images/swagbucks.jpg
Thanks Mike!
I was just about to ask for this part. cooll;
Re: Don't allow webbrowser to cache your website - heres how
Posted: Sun Feb 12, 2012 10:43 pm
by mikethedj4
You're very welcome
