[wp-trac] [WordPress Trac] #14539: Cache-Control / Expires headers not applied to files in Multisite files location
WordPress Trac
wp-trac at lists.automattic.com
Mon Jul 16 03:05:03 UTC 2012
#14539: Cache-Control / Expires headers not applied to files in Multisite files
location
--------------------------+------------------------------
Reporter: spherical | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Multisite | Version: 3.0.1
Severity: normal | Resolution:
Keywords: dev-feedback |
--------------------------+------------------------------
Comment (by dd32):
> I'm explicitly setting a access plus 1 year ExpiresByType header for
image/* (also does the same with image/jpeg) yet a file being served from
/files has an Expires header well beyond that (and in fact, breaks RFC
specs because of it):
This is because the files in /files are routed through ms-files.php,
AFAIK, Nginx doesn't apply ExpiresByType to dynamic files and/or when a
Expires-like header is already set.
> Receiving the same issues using Nginx, although they are returning as
304 instead of 200 in my case. It will only take the global expires
setting and not adhere to the one I've set for static objects, png/jpg/js
etc.
This backs up my original thought, that per-type won't apply, but Global
expires do (As they apply regardless of type). ms-files.php does return
304's however if the client supports ETags:
http://core.trac.wordpress.org/browser/trunk/wp-includes/ms-files.php#L73
- ms-files.php also sets the Expires Header to +3.16 years (Ah how i wish
that was 3.14..) which just so happens to be 100 million seconds.
IMHO, There isn't many things that can be done here, One could try
preventing ms-files.php from outputting a Expires header, this might solve
it, Alternatively, looking into bypassing ms-files.php (for more
performance) might be a better idea: #19235
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14539#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list