NYCPHP Meetup

NYPHP.org

[nycphp-talk] Double Loading PHP as image - Firefox or PHP?

Mark Armendariz nyphp at enobrev.com
Wed Nov 30 19:37:04 EST 2005


> Whoa. So let me get this straight... if it's a regular image, 
> FF only hits once. But if it's your script, then FF hits twice?

I'm not sure about calling a plain image.  I'll have to check my logs...


> What happens if you remove the Content-Disposition header?

Same. Same.
----------
11/30/2005 16:28:07: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
Gecko/20051111 Firefox/1.5
11/30/2005 16:28:08: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
Gecko/20051111 Firefox/1.5 


Adding caching headers (even a day ahead) didn't work either.  Well, not
directly. When called from an img tag, the caching headers take care of
business.  Here's what I used:

header('Expires: ' . gmdate("D, d M Y H:i:s", time() + 2) . ' GMT');	
header('Cache-Control: max-age=2, must-revalidate');	

I'm completely confused as to why it double-loads on a direct call.  I
suppose I can keep the caching as my workaround, since the plan is to always
call through an image tag.  But I really wish I understood why...
Whhhyyyyy!!!!!

Mark




More information about the talk mailing list