httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Jones" <Jeremy.Jo...@s1now.com>
Subject RE: [users@httpd] Adding a Header to the httpd response
Date Mon, 21 Apr 2008 12:18:07 GMT
Hi,

Something like this in httpd.conf works for me: 



    <IfModule mod_headers.c>
         <LocationMatch \.(js|gif|jpe?g|css)>
             Header append "Cache-Control" "public"
         </LocationMatch>
         <LocationMatch \.s?html>
             Header append "Cache-Control" "private"
         </LocationMatch>
    </IfModule>


so without the LocationMatch it could handle everything I think.


Jeremy




-----Original Message-----
From: Mohammed Salih [mailto:linusali@gmail.com] 
Sent: 21 April 2008 13:09
To: users@httpd.apache.org
Subject: [users@httpd] Adding a Header to the httpd response

Hi All,

How can I add a header, if it is not set by the application.

I want to add Cache-Control header to all http responses, if it is not
set by the back-end application like PHP or application server like
tomcat.

I tried a combination of SetEnvIf and Header, but SetEnvIf is only
fused for requests.

Can any one please guide me in the right path? (Sorrmy English is poor)

Thanks in advance.
Salih

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


--------------------------------------------------------------------
This email has been scanned for viruses and other threats
using Newsquest's Ironport email filters

This e-mail, including any attachment, is private and
confidential. 
It should not be read, copied, disclosed or otherwise used by
any person other than the intended recipient(s).
If you have received this e-mail in error, please notify the
sender immediately.
Newsquest reserves the right to monitor e-mails in
accordance with the Telecommunications (Lawful Business
Practice)
(Interception of Communications) Regulations 2000.
 
Newsquest Limited. 
Registered in England, number 3105111 .  Registered office:
58 Church Street, Weybridge, Surrey KT13 8DP
--------------------------------------------------------------------

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


Mime
View raw message