Re: way for me to turn off if-modified-since & always return 304 reply ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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]

 </Location>


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:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux