NEWBIE: cache swf content?

AJ Weber aweber at
Wed Sep 12 13:28:27 UTC 2012

I am running a few webapps on Tomcat, and placing nginx in front for 
SSL, content caching and to remove some of the load from Tomcat where 
possible (currently testing v1.2.3 on CentOS 6.x).

I have most of the configuration working well (nginx is very slick, and 
pretty easy to configure).  However, I have some static content like swf 
(flash) files that are served to the client browser with parameters, and 
I think this is why nginx is not caching them.  For example, 
".../testflash.swf?dt=0123456789"  (dt is typically a timestamp, but is 
a unique identifier, nonetheless).  Since this swf file does not 
actually change (incredibly rarely, in a major "upgrade", and I would 
purge the cache at that point), is there a way to tell nginx to cache it 
regardless of the url-parameters appended?

These files, and most of the other content, have ETag's and 
Last-Modified-Date (both).  In this case there is no explicit 
Cache-Control in the header.

Related question:  If content has an ETag from the source server (the 
content that nginx fetches already has an ETag), is there a way to force 
nginx to cache the content based on that ETag?  I _think_ this is 
different to the ETag support that is coming in the > 1.3.3 versions, as 
that seems to say that it will actually add tags for content.  In this 
case, I would've expected nginx to cache any content with an ETag and 
especially with a Last-Modified-Date when no explicit Cache-Control 
header was provided.

Thanks for dealing with my newbie questions, I appreciate your time.

More information about the nginx mailing list