Forum

Expire header explanation

Amar
7 November 2011, 14:27
Hello Hugo

Could you please help me on how to use Expire option (and where) in hiawatha.conf? For example I want to set it for 1 week. Looked in manual pages but puting "Expire 1 weeks" gives me errors.

Hiawatha version: 7.8
Operating System: Debian
Hugo Leisink
7 November 2011, 18:55
The Expire option is available in UrlToolkit rules.
UrlToolkit {
ToolkitID = my_toolkit_rule
Match ^/some/pattern$ Expire 1 weeks
}

VirtualHost {
...
UseToolkit = my_toolkit_rule
}
Amar
7 November 2011, 19:01
Can it be used on extensions ? For example to match all .jpg's under /var/www ?

For example, this wont work for me either:

UrlToolkit {
ToolkitID = wordpress
RequestURI exists Return
Match .* Rewrite /index.php Expire 1 weeks
}
Hugo Leisink
7 November 2011, 19:18
Yes, it can be on extensions.
UrlToolkit {
ToolkitID = expire_jpegs
Match .*\.jpg$ Expire 1 weeks
}

Whether the jpegs are located in /var/www or not depends on for which website you use the toolkit rule and where that website is located.

What is it you try to achieve in your example?
Amar
7 November 2011, 20:40
Well I am trying to optimize my web server as much as possible : ). Couple testing sites said (recommended) puting expire headers so..

I know on nginx I had something like this :
expires               24h;
and that's is. Now in Hiawatha it seems there is no "global" option for this..
This topic has been closed.