SPECIAL OFFER: Only $59 for access to everything in OSTraining for 1 year! You save $85!  1
Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!

Disable browser caching

4 years 6 months ago #104751 by FireFly9
Disable browser caching was created by FireFly9
Is there a code to use on a page that disables the caching for that page for all or most browsers? I would like to try this on my municipal site home pages since people are missing updates. This is for my html sites, since Joomla seems not to have any caching.

Thanks
FF9

Please Log in to join the conversation.

4 years 6 months ago - 4 years 6 months ago #104759 by Valentin
Replied by Valentin on topic Disable browser caching
Hi FF9,

Are you using Joomla, right? Please consider taking a look to this tutorial that explains the cache features. See if one of the settings would match your specific needs: www.ostraining.com/blog/joomla/cache/

In my opinion, disabling cache completely in Joomla is a good way to start.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

4 years 6 months ago #104762 by FireFly9
Replied by FireFly9 on topic Disable browser caching
No - as I said, this is for one of my html sites (not joomla). I put this question under the coding category as well hoping that is where these questions might go if supported.


Thanks

Please Log in to join the conversation.

4 years 6 months ago #104781 by Valentin
Replied by Valentin on topic Disable browser caching
Thanks for the clarification.

Try this please:
<meta http-equiv="cache-control" content="no-cache" />

Tha code should be added inside your <head> tag

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

4 years 6 months ago - 4 years 6 months ago #105148 by FireFly9
Replied by FireFly9 on topic Disable browser caching
Works better in Firefox than it does in IE
That is.... in firefox navigating away from the page within the same site, and then going back to the page will display a change (for my tests).

However, IE works but you have to come into the page fresh from say the address bar to see the page change. Navigating around in the same site and then returning to the page that shouldn't cache, will not show the change. Not a huge deal, but I have heard that different browser use the non-caching command differently.

Also it doesn't validate.

I get this error:
Error Line 7, Column 54: Bad value cache-control for attribute http-equiv on element meta.
<meta http-equiv="cache-control" content="no-cache" />
For this site kenaston.ca/index.htm

Please Log in to join the conversation.

4 years 6 months ago #105160 by Valentin
Replied by Valentin on topic Disable browser caching
Hi FF9,

There are different ways to handle this setting:
<meta http-equiv="Expires" content="0">

In my opinion is possible you need to sacrifice valuable code if your plan is validate strictly to follow the standards with validator.w3.org/

Hopes this helps

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

4 years 6 months ago #105163 by FireFly9
Replied by FireFly9 on topic Disable browser caching
Can one use both codes on a page?

No I don't need the entire site to be strictly validated by W3 standards, and have been using several widgets and iframe codes that don't pass. This is ok, but thanks to validator I am finally getting all my sites cleaned up. I started some sites way back when dreamweaver was in it's 2nd version, so yup.... got lots of obsolete code happening - or did.

When I finish this project I can get back to the Joomla learning curve again. :P

Please Log in to join the conversation.

4 years 6 months ago #105201 by Valentin
Replied by Valentin on topic Disable browser caching
Hi FF9,

I suggest use one only.

Let us know if we can help you in something else

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!