Good day. There is a photo gallery . Is there any way to make it so that the images from this gallery are not saved in the browser cache? And also, how to make a click counter on the pictures?

  • one
    The cool script, very simply written, demonstrates how you can create spectacular things on native js without jquery. And about the cache was recently here hashcode.ru/questions/17994/… - makregistr

1 answer 1

Insert between head and / head tags:

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> 

Alternatively, you can do something similar for each image:

 { src: '1ef7ea6559.jpg<?=rand(1,100);?>' }, 

With the counter harder.

  1. You can make the picture be given to PHP by a file that previously recorded a "+1" click { src: 'image.php?img=1ef7ea6559' } .

  2. Probably, a simpler option is to make the counter on Ajax, all the more so in Jquery it is done elementary.

  • Thanks with the cache, we’ll think with the counter - jsh1984