How to add expiry date to external objects?

Status
Not open for further replies.

Rocke

Active Member
951
2010
43
0
I don't know if this is possible, but is there a way to determine expiry dates on external objects ?

[slide]http://s2.imgkeep.com/i/00010/rpjpn4ll8mkf.png[/slide]
[slide]http://s2.imgkeep.com/i/00010/369nza8sliue.png[/slide]

I used this code on .htaccess, but it's still not working.

Code:
# No ETags
Header unset ETag
FileETag none

# Caching -- mod_headers
<IfModule mod_headers.c>

# 1 Year = 29030400s = Never Expires
<filesMatch "\.(ico)$">
Header set Cache-Control "max-age=29030400, public"
</filesMatch>

# 1 Month = 2419200s
<filesMatch "\.(css|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2419200, public"
</filesMatch>

# 2.5 Days = 216000s
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=216000, public, must-revalidate"
</filesMatch>

# 5 minutes = 300s
<filesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=300, private, must-revalidate"
</filesMatch>

# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
 
3 comments
Status
Not open for further replies.
Back
Top