我知道,我们可以很容易地基地的RewriteCond任何HTTP 请求头。但是,我们检查(部分)在响应发送标头打算?特别是,在上次修改吗?
I know that we can easily base a RewriteCond on any http request header. But can we check (some of) the response headers that are going to be sent? In particular, the Last-modified one?
我想重写URL只在最后修改日期是早于30分钟,我想,以避免委托,办理入住手续的PHP文件,每一次从该目录中的文件的开销请求。
I want to rewrite a url only when the Last-modified date is older than 30 minutes and I'm trying to avoid the overhead of delegating that check to a php file every single time a file from that directory is requested.
在此先感谢!
推荐答案
出站头不存在,直到多
晚于的mod_rewrite
行事。目前也没有任何文件修改时间检查功能内置到的mod_rewrite
,所以你开始使用它制作的的外部重写程序的品种,以找出是否有问题的文件已被修改RewriteMap指令。
The outbound headers do not exist until much
later than mod_rewrite
is acting. There also isn't any file-modification-time checking functionality built into mod_rewrite
, so the closest you'd get using it is making a RewriteMap of the External Rewriting Program variety to find out whether the file in question has been modified.
如果我正确理解你的应用程序,你也可以考虑其在该目录中存储时间超过30分钟cron作业删除文件,然后重写一个文件不存在的条件。
If I understand your application correctly, you could also look into having a cron job delete files in that directory that are older than 30 minutes, and then rewriting on a file-nonexistence condition.
相关推荐
最新文章