I am doing something like this: if an image is cached on user's computer and its timestamp is the same as the one on the server, then display the cached version; otherwise, do NOT load the image from the server.
I guess maybe JavaScript can do this, so I tagged this post as javascript. If it is improper, please help me to re-tag it.
Edit: Here I give more details about what I am going to implement. I am working on something like a web-based file explorer, where thumbnails are loaded only if the user click on a "view thumbnail" button beside each image. If a thumbnail is already cached, use the cached version; otherwise, show a generic image icon.