Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 08-04-2007, 03:37 PM
orangeman orangeman is offline
Hatchling Croc
 
Join Date: Aug 2007
Posts: 2
Default Cache Files -> Won't work

Hello,

I'm trying to save bandwidth by having my site's visitors cache files over a day, week, or month.

I've tried several different methods to cache files by modifying the htaccess file, but they all give me apache errors.

Here's one method:
# MONTH
<FilesMatch "\\.(flv|gif|jpg|jpeg|png|ico|swf)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>

# WEEK
<FilesMatch "\\.(js|css|pdf|txt)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>

# DAY
<FilesMatch "\\.(html|htm)$">
Header set Cache-Control "max-age=43200"
</FilesMatch>

Referenced here: http://www.evolt.org/ultimate_htaccess_examples

What's wrong? What success have people had with forcing people to cache files?
Reply With Quote
  #2  
Old 08-04-2007, 04:06 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,163
Default Re: Cache Files -> Won't work

I'm curious about how much bandwidth you're using/have left/trying to save with this method?
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #3  
Old 08-04-2007, 05:59 PM
esl's Avatar
esl esl is offline
Emperor Croc
 
Join Date: Jan 2005
Location: Proud to be an American - USA
Posts: 2,184
Default Re: Cache Files -> Won't work

You are having a bandwidth issue with shared hosting, yes? The Swamp plan offers 2000gb bandwidth for under $15 per month.
__________________
Have a great day,
Evan
Reply With Quote
  #4  
Old 08-04-2007, 10:21 PM
orangeman orangeman is offline
Hatchling Croc
 
Join Date: Aug 2007
Posts: 2
Default Re: Cache Files -> Won't work

I don't need to upgrade my plan, but I don't want people to download the same pics/css/javascript that isn't changing with each session.

And I'm just really curious why this isn't working.
Reply With Quote
  #5  
Old 08-04-2007, 10:29 PM
gwyneth's Avatar
gwyneth gwyneth is offline
Veteran Croc
 
Join Date: Sep 2006
Location: Apostle Islands, Lk Superior
Posts: 5,927
Default Re: Cache Files -> Won't work

Quote:
Originally Posted by orangeman View Post
I don't need to upgrade my plan, but I don't want people to download the same pics/css/javascript that isn't changing with each session.

And I'm just really curious why this isn't working.
Try using much smaller values. For instance, your setting for weeks works out to 10,000 years and chances are almost no software is expecting to work with time values that high.
Reply With Quote
  #6  
Old 08-06-2007, 12:34 PM
gwyneth's Avatar
gwyneth gwyneth is offline
Veteran Croc
 
Join Date: Sep 2006
Location: Apostle Islands, Lk Superior
Posts: 5,927
Default Re: Cache Files -> Won't work

Quote:
Originally Posted by gwyneth View Post
Try using much smaller values. For instance, your setting for weeks works out to 10,000 years and chances are almost no software is expecting to work with time values that high.
Quote:
Originally Posted by Serra View Post
Google just put them on the 10000 year don't update list...
That's pretty funny.

However, orangeman, look at your value for months.

Generally, because very few software programs would ever encounter millions of months, in any context, their time fields would be unprepared for a seven-digit field length or input.

More structured/restricted end user applications, such as Excel or database entry forms, just won't allow millions of months to be entered, because the field length has restricted input to a more normal value (almost always 3 or 4--the most common 'long' month measurement would be 3600 for a 30-year mortgage).

I'm just speculating here, but there's a possibility that somewhere in the big server machine at least one of the dozens of Unix/Linux/apache routines that deal with time is stamping its little foot at dealing with millions of months.

Remember, no time function works in a vacuum--if it's a genuine time function it has to interface with other time routines (such as the server clock/calendar.)
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 11:03 AM.

 
Forum SEO by Zoints