|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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 |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
||||
|
||||
|
Quote:
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.) |
![]() |
| Bookmarks |
| Thread Tools | |
|
|