[removed] Disable caching of response from server to HTTP GET URL request

后端 未结 3 1931
一整个雨季
一整个雨季 2020-12-06 11:31

I want to turn off the cache used when a URL call to a server is made from VBScript running within an application on a Windows machine. What function/method/object do I use

3条回答
  •  失恋的感觉
    2020-12-06 11:59

    I don't think that the XMLHTTP object itself does even implement caching.

    You send a fresh request as soon as you call .send() on it. The whole point of caching is to avoid sending requests, but that does not happen here (as far as your code sample goes).

    But if the object is used in a browser of some sort, then the browser may implement caching. In this case the common approach is to include a cache-breaker into the statement: a random URL parameter you change every time you make a new request (like, appending the current time to the URL).

    Alternatively, you can make your server send a Cache-Control: no-cache, no-store HTTP-header and see if that helps.

    The

提交回复
热议问题