httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] way for me to turn off if-modified-since & always return 304 reply ?
Date Fri, 12 Sep 2008 17:43:02 GMT
André Warnier wrote:
> André Warnier wrote:
> 3d try :

supposes mod_setenvif, mod_rewrite, mod_header

  RewriteEngine on
  RewriteLog /var/log/apache2/mysite/rewrite.log
  RewriteLogLevel 9   (so we see what's happening)

  <Location /thelocation>

  # 1) check if there is a trigger header and set a var if so
  SetEnvIf If-modified-since (.*) wants_cache=1
  # 2) but unset the var if it's *not* an image request
  # (to let Apache handle that normally)
  SetEnvIf Request_URI !\.(gif|png|jpg)$ !wants_cache
  # 3) next, the condition is that the variable wants_cache is set
  RewriteCond %{ENV:wants_cache} ^1$
  # 4) and if so, we send a "not modified" response
  RewriteRule ^.*$ - [R=304,L]


Worth a try ?
(I'm learning mod_rewrite as I go along, I hope)

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message