简体   繁体   English

如何强制查询网址绕过野生动物园缓存?

[英]how to force query urls to bypass safari cache?

I'm implementing a simple web site based on python simplewebserver, that I'm planning to use through mobile safari (iPad). 我正在实现一个基于python simplewebserver的简单网站,计划通过移动Safari(iPad)使用。

The web page issues events to the webserver in the form of queries. 网页以查询的形式向网络服务器发布事件。 So the page.html has links in the form of 因此,page.html具有以下形式的链接:

<a href="page.html?event1">generate event 1</a>
<a href="page.html?event2">generate event 2</a>

The problem I'm having is that safari seems to be caching the "page.html?eventn", so after the first time, it does not issue the query to the server at all. 我遇到的问题是,Safari浏览器似乎正在缓存“ page.html?eventn”,因此在第一次之后,它根本不会向服务器发出查询。

How do I force the web client to issue the query every time? 如何强制Web客户端每次发出查询?

You need to set the 'Expires' header on the web server to a date in the past. 您需要将网络服务器上的“ Expires”标头设置为过去的日期。 The browser will then make a request to the server every single time rather than trying to serve a copy out of the local cache. 然后,浏览器将每次都向服务器发出请求,而不是尝试从本地缓存中提供副本。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM