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:
2d try :

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
# 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
# next, the condition is that the variable wants_cache is set
RewriteCond %{ENV:wants_cache} ^1$
# and if so, we re-direct this to /notmod
RewriteRule ^.*$ /notmod [L]
...
</Location>
<Location /notmod>
# this one should always send a "not modified" answer
...
</Location>

and now I'm stuck again, because I still don't know how to send back only headers, not a body. The general idea would be to redirect the calls to the original directory, which wanted images, to some generic URL which always sends back a "not modified" answer. It would be easier with mod_perl, but I'm trying to do this strictly with Apache modules.

---------------------------------------------------------------------
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