MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
How can I fix "(No max-age or expires)" with Amazon CloudFront?
Current time: 02-29-2020, 02:02 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I fix "(No max-age or expires)" with Amazon CloudFront?
08-27-2010, 11:48 AM
Post: #1
How can I fix "(No max-age or expires)" with Amazon CloudFront?
So here's the deal. I'm using Amazon's CloudFront product to deliver the .gif files for my site's template. There are about 30 individual files so it should help speed up the site. At some point I might get around to making a CSS sprite, but for now I'm not worried about that.

The problem now is when I look at my WPT results, it shows many lines of:
FAILED (No max-age or expires) - http://example.com/example.gif (one for each gif file).

So I know how to set the expires on my regular web server. I use apache so I put this in my .htaccess in the root:
Code:
# 2,592,000 is 30 days caching
<FilesMatch "\.(gif|png|jpg)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>

So the main question here is how do I enable that sort of cache control on AWS? I'm using a subdomain cdn.example.com as the CNAME for AWS, however the *domain* name of my main site is example1.com and the CDN *domain* name is actually a different domain, e.g. cdn.example2.net.

(The reason I'm using a .net domain for the CDN files is that domain is cookieless which is supposed to be a good thing when it comes to speeding things up)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How can I fix "(No max-age or expires)" with Amazon CloudFront? - swanny - 08-27-2010 11:48 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)