apache 无缓存,过期

发布于 2024-12-23 16:30:54 字数 515 浏览 4 评论 0原文

我正在尝试对我的网站上的 csv 文件强制执行无缓存。
我通过 apache 的文档将这些行添加到 httpd.conf 中:

ExpiresActive On
ExpiresDefault A0
<FilesMatch "\.(html|csv|htm)$">
ExpiresDefault A0
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>

但是当我第一次尝试获取该页面时,我在 csv 文件中得到了这个:

Request Method:GET  
Status Code:200 OK (from cache)  

你知道我做错了什么吗?!

谢谢!!

加比。

I am trying to force no-cache on csv file on my site.
I added those lines to httpd.conf, by the documentation from apache:

ExpiresActive On
ExpiresDefault A0
<FilesMatch "\.(html|csv|htm)$">
ExpiresDefault A0
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>

But when I am trying to get the page at the first time, i get this on the csv file :

Request Method:GET  
Status Code:200 OK (from cache)  

Do you have any idea what i am doing wrong?!

Thanks!!

Gabi.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

趴在窗边数星星i 2024-12-30 16:30:54

我检查了一下,发现我启用了 Django 中间件,它们处理了缓存..我禁用了它,现在它可以工作了..

抱歉..:)

I checked it out and saw I have Django Middleware enabled, thet handled the cache.. I disabled it and now it works..

Sorry.. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文