I’ve run several tests since switching some images over to a CDN and I’m seeing differing results each time in the “Leverage browser caching of static assets” and “Use a CDN for all static assets” sections of the report.
This is the most recent test of one of our pages where the product images and some of the template images use a CDN:
http://www.webpagetest.org/result/120821_KW_6HN/
This is a previous test for the same page (no changes were made between tests):
http://www.webpagetest.org/result/120821_55_6GB/
The htaccess file in the images directory on both the main domain and the CDN domain contains this code:
<FilesMatch “.(jpg|jpeg|png|gif|swf)$”>
Header set Cache-Control “max-age=604800, public”
I’ve tested individual images served from the CDN repeatedly on different machines and, initially, I get A’s across the board, then on re-test I get an F for browser caching. I ran this test on one of the CDN images just before posting here which shows an F for browser caching.
http://www.webpagetest.org/result/120821_RQ_7QW/
But when I check the same image on Redbot, it shows Cache Control in the headers.
When I test any images on the main domain (where browser caching has been in place for years) the results consistently show cache control is working.
The main domain and CDN domain are both on the same dedicated server.
Yslow and PageSpeed on Firefox also show inconsistent results for the CDN images.
I don’t know if this inconsistency is a problem with the CDN set up, something to do with local caching or an issue with webpagetest. Any help would be appreciated!