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

后端 未结 8 1531
灰色年华
灰色年华 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:36

    Append a unique number to the end of the image src

    ie

    ";
    

    do this only on the form for the updating avatar

    works for me

    btw, this works well for forcing updates of other static files

    i.e. html for css files is

     
    

提交回复
热议问题