jquery - how to refresh same url image and also preserve caching? -


I have found that most of the solutions to download the image every time after the image link "? + Time ( ) ", However

Can ifModified help in AZAX?

Any suggestions are welcome, this is not an ideal solution. Thanks!


Edit:

Is there any way in the ink without involving "? + ..."?

And consider that the image may be a remote resource.

Ideal that you attach file revision time (on server) or ** PHP file time () ** Timestamp This way, when you change the image on the server, the timestamp changes and the new version of the image gets all users immediately (at the next load).

But you must use it in the server side language, such as PHP for more information Google "filemtime ()".

Representative xample:

  & lt; Img src = "image.png?"? Lt; php echo filemtime ('image.png');> "/ & gt;   

or:

    

You can do this for yourself Function can also write:

  function image ($ file) {return $ file. '?'. Filemtime ($ file);} echo '' lt; img src = "'. Image ('image.png'). '' / 'Gt;';    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -