I'm dynamically generating a page by PHP. I am using the site's output string to generate a Etag and check that to send a 304 (not modified) when the site hasn't changed since the last request.
I am now trying to improve the caching of the pictures on my site as well. There are between 6 and 30 pictures (jpg, 70 - 200 KB) on each site. I want the user to reload the picture if its content has changed. I am thinking about doing this by adding a querystring to each picture's URL:
src="'.$files[$x].'?id='.md5_file($files[$x]).'"
Is this too complicated and generates too much workload on each request or is it worth it? As I said: I'm generating those md5-hashs for each image and then one md5-hash for the output string to use it as an Etag on each request.
These are the Response-Headers from my Images:
HTTP/1.1 304 Not Modified
Date: Mon, 10 Dec 2012 08:56:49 GMT
Server: Apache
Connection: keep-alive, Keep-Alive
Keep-Alive: timeout=1, max=99
ETag: "360f-4d02f5fcfc34f"
Expires: Mon, 07 Jan 2013 08:56:49 GMT
Cache-Control: max-age=2419200, must-revalidate
Thank you very much!