Disable cache for some images

前端 未结 13 1414

I generate some images using a PHP lib.

Sometimes the browser does not load the new generated file.

How can I disable cache just for images created dynamica

13条回答
  •  生来不讨喜
    2020-11-22 08:08

    Changing the image source is the solution. You can indeed do this by adding a timestamp or random number to the image.

    Better would be to add a checksum of eg the data the image represents. This enables caching when possible.

提交回复
热议问题