Re:

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

 



OK actually that didn't work :(

I'm doing this:

SetEnvIfExpr "%{REQUEST_URI} =~ /^(.+)(?:\?|$)/" CACHE_URI=$1
SetEnvIfExpr "md5(%{ENV:CACHE_URI}) =~ /^(.+)$/" CACHE_MD5_URI=$1

Then:
<If "-f '/home/bohwaz/cache/web/%{ENV:CACHE_MD5_URI}'">

When doing a strace I can see that Apache is doing a stat on
/home/bohwaz/cache/web/ and not on /home/bohwaz/cache/web/MD5_HASH

My understanding of the issue is that the variables defined by
SetEnvIfExpr are not available in <If> conditions.

So I resorted to using RewriteRules:

RewriteCond %{REQUEST_URI} ^(.+)(?:\?|$)
RewriteRule ^ "-" [E=CACHE_URI:%1]
RewriteCond expr "md5(%{ENV:CACHE_URI}) =~ /^(.+)$/"
RewriteRule ^ "-" [E=CACHE_URI_MD5:%1]
RewriteCond %{DOCUMENT_ROOT}/.cache/%{ENV:CACHE_URI_MD5} -f
RewriteRule ^ /.cache/%{ENV:CACHE_URI_MD5} [END]

And it works. But it would have been nice to be able to use <If> as
it's easier to read.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-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