How to prevent Ajax/javascript result caching in browsers?

前端 未结 5 1798
遥遥无期
遥遥无期 2020-11-28 13:13

How to prevent browsers from caching Ajax results? I have and event triggered Ajax script the displays results only when the browsers data has been cleared.

Tes

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 13:29

    Add a random query string to the URL you are sending.

    E.g. if the Ajax request is sent to "http://www.xyz.com/a" then add a random string at the end: "http://www.xyz.com/a?q=39058459ieutm39"

提交回复
热议问题