Re: Location - Match

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

 



On Mon, Dec 7, 2009 at 06:49, Rajwinder-office Singh
<rajwinder.makkar.office@xxxxxxxxx> wrote:
> Here is one simple looking requirement :
>
> I want to put max-age header of value X on my home page and a value of Y for
> rest of my website.
>
> index.html is my default page but remember i cannot put
>
> <LocationMatch  "^/index.html">
> Header set Cache-Control max-age=X
> </LocationMatch>
>
> As people will be hitting my website as : : http://www.abc.com and NOT
> http://www.abc.com/index.html
>
> Please suggest.
>
>
> Now while trying things i came across this :
>
> <LocationMatch  "^/[a-z]">
> Header set Cache-Control max-age=7200
> </LocationMatch>
>
> Ideally it seems that above rule will "NOT" apply to "/" alone. But it does
> ;-) Now try this :
>
> <LocationMatch  "^/([a-h]|[j-z]">
> Header set Cache-Control max-age=7200
> </LocationMatch>
>
> This one will "NOT" apply to "/" alone. So some how character "i" matches
> "/" ;-)
>
> Thanks
> Rajwinder Singh
>

Use mod_expires, it will set Cache-Control for you, and use
ExpiresDefault for the default expiry policy:

ExpiresActive On
ExpiresDefault a7200 # or ExpiresDefault "access plus 2 hours"

<Location "/index.html">
    ExpiresDefault "access plus <somethingelse>"
</Location>

I use this configuration and it works wonderfully (I use
ExpiresDefault "now" for index.html however).

You can also use ExpiresByType, but it won't be suitable for your case, I think.

-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@xxxxxxxxxxxx
40 avenue Raymond Poincaré
75116 Paris

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