Preventing Images being cached in the browser

前端 未结 2 931
独厮守ぢ
独厮守ぢ 2021-01-28 09:56

I have a feature of \"Browse Pictures\" where there are thumbnails and when a user clicks it expands.

Now, both these images are stored in separate virtual directories w

2条回答
  •  遥遥无期
    2021-01-28 10:19

    It sounds like you don't want to prevent them from being cached as such, but you want to give them different URLs.

    If they do have different URLs, then this is not a caching problem.

    To prevent caching, you use a cache-control:no-cache HTTP response header when serving the images. (are you using Apache?)

    But if you really prevent caching, your data transfer will be higher than it needs to be, every time they visit your gallery, they will be fetching your images.

提交回复
热议问题