0

I am reading about HHT caching, found a website article here which explains some things but I still don't get it since I am a total newb and its the first time I have heard of this.

First of all, using firebug I have noticed that I have some elements which rarely change like: 1. sites logo; 2. sites css; 3. sites jquery; 4. about 4 images which are used for styling.

I found this code:

ExpiresActive On
ExpiresDefault A0


# 1 YEAR - doesn't change often
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
</FilesMatch>

# 1 WEEK - possible to be changed, unlikely
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
ExpiresDefault A604800
</FilesMatch>

# 3 HOUR - core content, changes quickly
<FilesMatch "\.(txt|xml|js|css)$">
ExpiresDefault A10800
</FilesMatch>

But:

  1. I don't know where to put it. I'm not sure I can modify my htaccess because I have wordpress which rewrites everything. Where does this code go?

  2. Is there a code I can put in the sites header, maybe php?

  3. While I have css, js, jpg elements that do not change, I have others that do change, sometimes every 5 minutes because of a cronjob. The code above dictates the files by gender. I need a way to specify the exact files which need caching.

Please help:)

webmasters
  • 5,663
  • 14
  • 51
  • 78

1 Answers1

0

What you see there is configuration code for the apache conf. You could very specifically set the caching meta information there. The approach to set this information by file extentsion is a good start.

However, you might want to have a look here: How to set HTTP headers (for cache-control)?

Community
  • 1
  • 1
Kai Mattern
  • 3,090
  • 2
  • 34
  • 37