how to clear or replace a cached image

后端 未结 20 1561
囚心锁ツ
囚心锁ツ 2020-11-29 02:04

I know there are many ways to prevent image caching (such as via META tags), as well as a few nice tricks to ensure that the current version of an image is shown with every

相关标签:
20条回答
  • 2020-11-29 02:38

    try below solutions,

    myImg.src = "http://localhost/image.jpg?" + new Date().getTime();

    Above solutions work for me :)

    0 讨论(0)
  • 2020-11-29 02:42

    Add the image url like this

    "image1.jpg?" + DateTime.Now.ToString("ddMMyyyyhhmmsstt");

    Just add random string in the querystring

    Thank You

    Raju Jetla

    0 讨论(0)
提交回复
热议问题