XMLHttpRequest: How to force caching?
问题 I'm newer to XMLHttpRequests since I've previously used jQuery's AjAX method. However I need to work in a web worker and now I have to use the classic XMLHttpRequest for performance issues. I'm trying to rebuild the cache -property from jquery. If cache should be disabled I add this: xhr.setRequestHeader("Cache-Control", "no-cache"); But what header should I set if I want to force caching (not prevent)? 回答1: There are a variety of headers you can set to encourage caching, but they (including