How to clear browser cache when re-uploading image with same filename, in php?

后端 未结 8 1495
灰色年华
灰色年华 2021-02-18 19:05

I have a listing of items, that also contains an image thumbnail. Sometimes I need to change the thumbnail image, but keep the filename the same. Is there a way to force the bro

8条回答
  •  逝去的感伤
    2021-02-18 19:29

    I found out that one of the best ways to do this is by having the same URL for getting and posting an image (REST).

    POST /my/image (Cache-control: no-cache, must-revalidate)

    GET /my/image (Cache-control: must-revalidate)

提交回复
热议问题