Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- caching not working for subdomains of main site


hottrout - 8:51 am on Sep 12, 2012 (gmt 0)


Lucy, thanks for the response, it is appreciated. I was lazy and should have updated the original post. In the time between my first post and my bump last night I had actually changed this code as follows :-

# BEGIN Compress text files
<ifModule mod_deflate.c>
<filesMatch "\.(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</ifModule>

# BEGIN Expire headers
ExpiresActive On
ExpiresDefault "now"
# Configure mime expires
ExpiresByType image/x-icon "access plus 30 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType application/x-shockwave-flash "access plus 7 days"
ExpiresByType text/css "access plus 7 days"
ExpiresByType text/javascript "access plus 7 days"
ExpiresByType application/javascript "access plus 7 days"
ExpiresByType application/x-javascript "access plus 7 days"
ExpiresByType text/html "access plus 7 days"
ExpiresByType application/xhtml+xml "access plus 8 hours"

# Default - Set Cache-Control header to expire everything 3 days from last access
ExpiresDefault A259200
Header set Cache-Control: "must-revalidate"

# Cache images for up to two weeks -- no forced revalidation (longer than 2 weeks is pointless)
<FilesMatch "\.(gif|jpe?g|png|js|bmp|ico|pdf|mov|wmv)$">
ExpiresDefault A1209600
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</FilesMatch>

# Infrequently updated -- expire after 3 days
<FilesMatch "\.(html?|css|txt)$">
ExpiresDefault A259200
Header set Pragma "public"
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
</FilesMatch>

# Frequently-updated files, expire after 2 hour
<FilesMatch "\.(php)$">
ExpiresDefault A7200
Header set Cache-Control: "no-cache, must-revalidate"
</FilesMatch>

Header unset ETag
Header unset Last-Modified

# Preserve bandwidth for PHP enabled servers
php_value zlib.output_compression 16386


Now with this code I have noticed improvements, however it is still the case that google analytics does not see any subdomains as being cached. I have www.example.com and I also have two subdomains, files.example.com and images.example.com. These subdomains are just a record pointed to a subfolder of the main website.

Can you advise as to why these subdomains do not seem to be cached?


Thread source:: http://www.webmasterworld.com/apache/4480565.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com