2009
12.14

Well, “perfect” might be a little exaggerated although I consider this a good configuration at the moment.
You can put this globally into your httpd.conf or separately in every vhost configuration file you need it.

1
2
3
4
5
6
7
8
9
10
 
        ExpiresActive On
        ExpiresByType text/css "access plus 1 month"
        ExpiresByType text/javascript "access plus 1 month"
        ExpiresByType application/x-javascript "access plus 1 month"
        ExpiresByType application/javascript "access plus 1 month"
        ExpiresByType image/png "access plus 1 year"
        ExpiresByType image/jpeg "access plus 1 year"
        ExpiresByType image/gif "access plus 1 year"
        ExpiresByType image/x-icon "access plus 1 month"

Make sure you versionize your JavaScript/CSS to be able to force an update, in case you change them.
Example:

1
2
3
4
5
6
 
    My Example
 
Some Content
 
    <script src="javascript.js?version=1" type="text/javascript"><!--mce:0--></script>

You should also give newly updated pictures new names!

Over and out,
JaZz

No Comment.

Add Your Comment
*