I\'m totally new to how to cache images.
I output all images in a gallery with PHP, and want the images already shown, to be cached by the browser, so the PHP script
You could store the generated images in a directory called "showImage" so that you would embed them like this
Then you place a .htaccess file in the very same directory that will call showImage.php?id= in case the file does not exist, e.g.:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.jpg$ showImage.php?id=$1 [QSA,L]
Just read in your comment that you want to do client side caching: just set the caching-related HTTP headers according to http://www.mnot.net/cache_docs/