How to prevent the browser from caching a json file

后端 未结 4 1683
野趣味
野趣味 2020-12-04 17:09

So I\'m making this little project and I\'m having some troubles with catching. One thing that\'s not working is the browser keeps caching the json file that contains save d

4条回答
  •  自闭症患者
    2020-12-04 17:37

    Two options:

    1. Add a mySaveFiles.json?t=timestamp query parameter to the end of the url.
    2. Pull the file in with the XmlHttpRequest object (you still may need to add a timestamp depending on the server).

提交回复
热议问题