Far Future Expires Header

Status
Not open for further replies.

Rex100

Baseband Member
Messages
30
Tech-Forums,

I want to add a far Future Header Header to tell people's browser to hold on to my images (instead of reloading them from the server) to improve download speed for repeat visitors. I wrote this for my HTaccess file.

ExpiresActive On
ExpiresByType text/html "access plus 25 minutes"
ExpiresByType image/gif "access plus 5 years"
ExpiresByType image/jpg "access plus 5 years"

I added the text directive so that when I edit my text it won't be long before most visitors see the change.

1) Where in the HTaccess file would I put these directives?
Right now the general order of my HTacess file is
50 or so 301 redirects
Error page directions
Front Page stuff from the starting stock version of the HTAccess file
Stuff about Wordpress.

2) Should I use this style of directive use instead
ExpiresByType image/gif A157680000 ?

I read that "A is used, for image files that don't change very often, particularly for a set of related documents that all refer to the same images (i.e., the images will be accessed repeatedly within a relatively short timespan).

My images don't change often but will be accessed more often in a relatively short peroid of time as traffic increase - as any ordinary website working on increasing traffic would.


Thanks For the help,

Rexx





(before or after a bunch of redirects, and before or after

I guess that code would be

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 25 minutes"
ExpiresByType image/gif "access plus 5 years"
ExpiresByType image/jpg "access plus 5 years"
</IfModule>


Down at the bottom after the Fromt Page code is
the module rewrite for wordpress.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


So should the expires module come just after or just before the rewrite module?

Thanks
 
In the question above, ignore "(before or after a bunch of redirects, and before or after". 'Not sure how that got there.
 
Status
Not open for further replies.
Back
Top Bottom