Welcome to WebmasterWorld Guest from 220.127.116.11
<img border="0" width="1" height="1" src="http://www.example.com/somedirectory/somescript.php?somevariable">
In the .htaccess file for that site (example.com), I have the following code:
ExpiresByType text/html "access plus 1 day"
ExpiresByType text/css "access plus 1 day"
ExpiresByType text/plain "access plus 1 day"
ExpiresByType image/gif "access plus 3 months"
ExpiresByType image/png "access plus 3 months"
ExpiresByType image/jpeg "access plus 3 months"
My question is, would any of the code in .htaccess cause the pixel tag/script to be cached, instead of loaded anew every time someone hits a page that contains it?
I'm experiencing an issue where the pixel tag is only picking up the first page view, and is supposedly being served up on subsequent pages but is not firing.
If on the other hand, your script redirects to that image, then it will be affected by the ExpiresByType settings above (I assume it's a 1x1 transparent .gif image, 43 bytes, etc).
You can use the "Live HTTP Headers" add-on for Firefox/Mozilla browsers to view the HTTP headers passing back and forth between your server and your browser to confirm or rule out the redirection and to check the Expires and Cache-control headers.
Alternately, just modify your PHP script to output these headers along with the 200-OK status for the tracking URL requests. You should actually be returning the "text" of a 1x1 transparent .gif file too, for the 'cleanest' implementation. Othewise, some browsers *may* throw a broken image icon on the page, which makes your tracking "quite non-transparent."
The 'normal' way to do all of this would be to link to 'tracking.gif?afid=1234', rewrite (mod_rewrite) that request to your tracking script when it arrives at your server, serve the requested transparent 1x1 .gif image by 'including' it from within your script, and send along the 200-OK status and cache-control headers, making the image non-cacheable.