Forum Moderators: phranque

Message Too Old, No Replies

Last Modified causes my server to stutter on reload

         

jamie

11:05 am on Nov 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi,

when i manually send a last modified header with my dynamic pages, everytime i press reload, the page-load pauses half way through for a few seconds.

if i ctrl + refresh i get a normal page load.

this pause only happens when

a) i reload dynamic pages (static html pages are delivered normally)
b) when i manually send a last modified header (if i leave it out or use an expires header instead, the dynamic pages load normally)

why is the last modified header causing this? the headers which are sent for dynamic and/or static pages are identical.

much appreciate any help!

AlexK

8:26 am on Nov 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I truly have no idea! I am sure that you know that the default settings for Apache cannot normally process Last-Modified (or Expires) for dynamic pages.

If you run PHP and want to add processing for either of the above, look at this thread [webmasterworld.com]. Not a direct answer, but the best I can offer (except for trudging through httpd.conf, of course).

jamie

8:59 am on Nov 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi alexk,

i send all the correct headers myself using header(), albeit not nearly as elegantly or as thoroughly as you do.

comparing the headers of one of my static pages with one of the dynamic pages returns *exactly* the same results - hence my puzzlement.

however i have now tracked it down to the function call i use which checks the HTTP_IF_NONE_MATCH and HTTP_IF_MODIFIED_SINCE and if they don't match, then returns

header('HTTP/1.0 304 Not Modified');
exit();

it seems as though i am missing an ob_end_clean(); before the exit. now the page loads perfectly.

obviously your post provided the inspiration :)

thanks