You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by 7BOOK <wa...@hotmail.com> on 2010/10/26 23:44:39 UTC

Re: [users@httpd] How can I configure setting a Header in httpd.conf based on content type?

Hi Tom,

as this topic discussed,
(1).I tried following, it does not at all
Header set Cache-Control "no-cache" 
<FilesMatch "\.(gif|jpg|jpeg|png|js|css|swf)$"> 
    Header set Cache-Control "max-age=3600" 
</FilesMatch> 
(2).I am using proxy disk cache, I tried kinds of regex format using
FilesMatch, all failed
(3).Is there a solution to set header fields inside httpd.conf (not
.htaccess) ?

Thanks in advance!

Michael
wantsth@hotmail.com






Tom Evans-3 wrote:
> 
> On Thu, Mar 11, 2010 at 11:51 AM, Baljeet Nijjhar
> <ba...@googlemail.com> wrote:
>> In fact, FilesMatch doesnt seem to work for anything (inlcuding the
>> string
>> you sent for images etc). I'm using my HTTP server as a proxy server. I
>> wonder if I need to do something with Directory as well ...
>> Right now, I'm feeling like the only solution is to set them up in my
>> application code using a filter. Is this recommended, or must it done at
>> the
>> proxy server level?
>>
> 
> FilesMatch matches files - real files, existing on disk. If your
> handler doesn't refer to files on local disk, eg proxying, then it
> will never match a Files or FilesMatch section.
> 
> The equivalent solution is to use LocationMatch. See
> http://httpd.apache.org/docs/2.2/sections.html#filesystem for details
> on the differences between the two,
> 
> Cheers
> 
> Tom
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-can-I-configure-setting-a-Header-in-httpd.conf-based-on-content-type--tp27850927p30062058.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How can I configure setting a Header in httpd.conf based on content type?

Posted by 7BOOK <wa...@hotmail.com>.
Hi Igor Galić,

Thanks a lot! Great help to me.
And I have another question: is there a way for proxy (httpd.conf) to detect
that some static files are updated on real server ? I am realy appreciated!

Michael



Igor Galić wrote:
> 
> 
> ----- "7BOOK" <wa...@hotmail.com> wrote:
> 
>> Hi Tom,
>> 
>> as this topic discussed,
>> (1).I tried following, it does not at all
>> Header set Cache-Control "no-cache" 
>> <FilesMatch "\.(gif|jpg|jpeg|png|js|css|swf)$"> 
>>     Header set Cache-Control "max-age=3600" 
>> </FilesMatch> 
>> (2).I am using proxy disk cache, I tried kinds of regex format using
>> FilesMatch, all failed
>> (3).Is there a solution to set header fields inside httpd.conf (not
>> .htaccess) ?
> 
> I'm doing it vice versa:
> 
> http://blag.esotericsystems.at/2010/02/introducing-more-caching/
> 
>> Thanks in advance!
>> 
>> Michael
>> wantsth@hotmail.com
> 
> i
> 
> -- 
> Igor Galić
> 
> Tel: +43 (0) 664 886 22 883
> Mail: i.galic@brainsware.org
> URL: http://brainsware.org/
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-can-I-configure-setting-a-Header-in-httpd.conf-based-on-content-type--tp27850927p30068872.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How can I configure setting a Header in httpd.conf based on content type?

Posted by Igor Galić <i....@brainsware.org>.
----- "7BOOK" <wa...@hotmail.com> wrote:

> Hi Tom,
> 
> as this topic discussed,
> (1).I tried following, it does not at all
> Header set Cache-Control "no-cache" 
> <FilesMatch "\.(gif|jpg|jpeg|png|js|css|swf)$"> 
>     Header set Cache-Control "max-age=3600" 
> </FilesMatch> 
> (2).I am using proxy disk cache, I tried kinds of regex format using
> FilesMatch, all failed
> (3).Is there a solution to set header fields inside httpd.conf (not
> .htaccess) ?

I'm doing it vice versa:

http://blag.esotericsystems.at/2010/02/introducing-more-caching/

> Thanks in advance!
> 
> Michael
> wantsth@hotmail.com

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org