Lunarpages Web Hosting Forum

Author Topic: Best Practice for Cache control  (Read 6934 times)

Offline LegendsTech

  • Space Explorer
  • ***
  • Posts: 9
Best Practice for Cache control
« on: January 12, 2010, 08:32:11 AM »
My wife and I have a fairly large website (3000+ pages) with tons of images, etc.  All pages are html.  My wife started our site 6.5 years ago and is self taught through forums and the like.  Since starting to help her more this year, I have noticed that we seem to lack cache control.  When updating a page, a viewer must refresh to see any changes, even if the changes were made the previous day. 

What is the best practice in forcing a refresh on our older pages when they have changed, without forcing a refresh on existing images (worried about load times, bandwidth, etc that could be problems if forcing everything to refresh)? 

Our site is http://www.legendsofamerica.com

Offline DEddleman

  • Spacescooter Operator
  • *****
  • Posts: 34
  • Elite!
Re: Best Practice for Cache control
« Reply #1 on: January 12, 2010, 08:57:18 AM »
If you're interested in cache control, check this out: http://snipplr.com/view/4264/cache-control-with-htaccess-files-match/

Simply use those directives within an .htaccess file to define what you want to expire and when.

While this method may not get you exactly what you want, it's impossible to get exactly what you're looking for. This is because how browsers handle caching. A browser doesn't have to cache or doesn't even have to *listen* to cache lifetime responses.

Offline perestrelka

  • Master Jedi
  • *****
  • Posts: 1397
Re: Best Practice for Cache control
« Reply #2 on: January 13, 2010, 07:14:30 AM »
If you're interested in cache control, check this out: http://snipplr.com/view/4264/cache-control-with-htaccess-files-match/

Simply use those directives within an .htaccess file to define what you want to expire and when.

While this method may not get you exactly what you want, it's impossible to get exactly what you're looking for. This is because how browsers handle caching. A browser doesn't have to cache or doesn't even have to *listen* to cache lifetime responses.

Anyway I would recommend LegendsTech to give this way a try reducing cache time for html files.
Kind Regards,
Vlad Artamonov

Offline LegendsTech

  • Space Explorer
  • ***
  • Posts: 9
Re: Best Practice for Cache control
« Reply #3 on: January 13, 2010, 09:11:22 AM »
Thank  you both VERY much for pointing me this direction.  I'm so happy to know that we wont have to modify each page.  I do understand the limitations, but at this time we have nothing, so this is a great step forward!


Offline wilmatan

  • Intergalactic Cowboy
  • *****
  • Posts: 51
Re: Best Practice for Cache control
« Reply #4 on: May 04, 2011, 07:02:56 AM »
Cache control is really great for businesses and online website that have many images, and for those who updates frequently. I hope it went well for you and your wife LegendsTech  :bounce: :bounce: :bounce: