[wp-trac] [WordPress Trac] #22160: Etags served by ms-files.php not specific enough

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 10 23:15:01 UTC 2012


#22160: Etags served by ms-files.php not specific enough
-----------------------------+--------------------------
 Reporter:  xiffy            |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Media
  Version:  3.3.2            |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 Today I was tracking an Etag issue we had where different versions of
 images uploaded to wordpress had the same etags. I first looked at apache
 and reconfigured it to serve filesize mtime etags. To no avail.
 When investigating further i discovered that uploaded files get an etag
 from ms-files.php (line 57)

 {{{
 $etag = '"' . md5( $last_modified ) . '"';
 }}}

 which to my humble opinion should be something like:

 {{{
 $etag = '"' . md5( $last_modified . filesize($file)) . '"';
 }}}

 that way, images of different formats, created at upload time, which share
 the same mtime on a fast machine still get different etags.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22160>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list