网站由于前期同事在APACHE作了EXPIRE模块,所有在CLIENTCACHE过期时间设置得过长。

现在遇到的问题是,尽管已在APACHEHTTP.CONF设置了CACHE-CONTROL的内容,但除非在CLIENT端用F5或是CTRL+F5强制刷新的话,不然,打开新的浏览器或是MOUSE重新点击不会得到新的内容。

PAGESPEED,HTTPWATCH等查看CLIENTHTTPD HEADER内容,服务器设置生效,但客户端依然故我。

于是,用WIRESHARK抓包,原来,浏览器新窗口访问网站时,网站只返回了304代码,NOT MODIFIED,然后,未推送新的内容。原因是URLEXPIRED时间设置得太久,last modified,If-Modified-Since这些时间戳完全派不上用场,于是,APACHE就直接发送304代码了。

试过以下方案,无效。

http://stackoverflow.com/questions/3752658/how-to-have-apache-always-return-code-200-with-data-instead-of-304

Add the following directive to your apache config file

RequestHeader unset If-Modified-Since

This will ignore IF-Modified-Since header sent from client so you will get not 304 Not Modified response.

据说,要这样才可以,这就搞大发了呀~~

You can force browsers to cache something, but

You can't force browsers to clear their cache.

Thus the only (AMAIK) way is to use a new URL for your resources. Something like versioning.

~~~~~~

 CLIENT的CACHE清理失败再记录

今天,继续跟进看看。如果失败,那是天意~~

相关文章:

  • 2022-12-23
  • 2021-08-08
  • 2021-07-16
  • 2021-04-29
  • 2021-07-25
  • 2021-11-22
  • 2022-12-23
  • 2021-11-12
猜你喜欢
  • 2022-12-23
  • 2021-09-10
  • 2022-01-01
  • 2021-10-05
  • 2021-06-15
相关资源
相似解决方案