[wp-trac] [WordPress Trac] #2708: Setting Last-Modified causes intermittent blank pages

WordPress Trac wp-trac at lists.automattic.com
Sat May 6 18:56:01 GMT 2006


#2708: Setting Last-Modified causes intermittent blank pages
--------------------------+-------------------------------------------------
       Id:  2708          |      Status:  new                     
Component:  Optimization  |    Modified:  Sat May  6 18:56:01 2006
 Severity:  normal        |   Milestone:                          
 Priority:  normal        |     Version:  2.0.2                   
    Owner:  anonymous     |    Reporter:  peterjanes              
--------------------------+-------------------------------------------------
 I've been trying to write a plugin that sets the Last-Modified header for
 single posts.  (Yes, I've read #2335; I don't have any dynamic content
 like sidebars on my individual post pages.)  However, whenever I actually
 set the Last-Modified header the page becomes blank on every other reload;
 this also happens when users post comments on the page.

 The code is pretty simple:

 function lastmod() {
     if( is_single() ) {
         $modDate = mysql2date("D, d M Y H:i:s
 T",$wp_query->posts[0]->post_modified);
         header("Last-Modified: $modDate");
     }
 }
 add_action('wp_head','lastmod');

 Environment is WordPress 2.0.2, PHP Version 5.1.2.  In case it matters,
 the site on which this happens is hosted by DreamHost but is a manual
 install of WP.

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


More information about the wp-trac mailing list