mod_rewrite RewriteCond based on Last-modified? (.htaccess)

后端 未结 3 1490
暖寄归人
暖寄归人 2021-02-06 10:38

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 s

3条回答
  •  执笔经年
    2021-02-06 11:29

    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.

    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.

提交回复
热议问题