You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ABAPGUY <ab...@yahoo.com> on 2009/12/11 02:53:43 UTC

[users@httpd] mod_rewrite + mod_headers :How to set Cache instructions for Rewritten .swf content only ?

Hi Apache Experts,
I wish to set 2 Cache statements for .swf files (only) . I am rewriting using mod_rewrite and have enabled mod_headers .
My 1st attempt did not work  :

RewriteCond %{REQUEST_URI} \.(swf)$ [NC]
Header set Cache-Control "must-revalidate, proxy-revalidate"
Header set Pragma "public"
RewriteRule ^/<flash_dir>/(.*)\.swf https://<servername>/<flash_dir>/$1.swf [P,NC,L]

It seems RewriteCond is applied to the next Rewrite rule ..but the Headers are set for all subsequent Rewrite rules ..not what I wanted .
Is this the wrong way to do it ? How do I set the Headers for .swf files only ?

Regards
Daniel

Re: [users@httpd] mod_rewrite + mod_headers :How to set Cache instructions for Rewritten .swf content only ?

Posted by Igor Cicimov <ic...@gmail.com>.
<FilesMatch "\.(swf)$">
Header set Cache-Control "must-revalidate, proxy-revalidate"
Header set Pragma "public"
</FilesMatch>

or use mod_headers commands per content (read the mod_headers instructions
on apache.org)



On Fri, Dec 11, 2009 at 12:53 PM, ABAPGUY <ab...@yahoo.com> wrote:

> Hi Apache Experts,
> I wish to set 2 Cache statements for .swf files (only) . I am rewriting
> using mod_rewrite and have enabled mod_headers .
> My 1st attempt did not work  :
>
> RewriteCond %{REQUEST_URI} \.(swf)$ [NC]
> Header set Cache-Control "must-revalidate, proxy-revalidate"
> Header set Pragma "public"
> RewriteRule ^/<flash_dir>/(.*)\.swf https://<servername>/<flash_dir>/$1.swf
> [P,NC,L]
>
> It seems RewriteCond is applied to the next Rewrite rule ..but the Headers
> are set for all subsequent Rewrite rules ..not what I wanted .
> Is this the wrong way to do it ? How do I set the Headers for .swf files
> only ?
>
> Regards
> Daniel
>
>

RE: [users@httpd] mod_rewrite + mod_headers :How to set Cache instructions for Rewritten .swf content only ?

Posted by Manoj Samtani <ma...@hotmail.com>.


You can use the following code to cache only .swf files:

<FilesMatch *.swf$>
Header set 604800 public must-revalidate
</FilesMatch>


regards

Manoj
Date: Thu, 10 Dec 2009 17:53:43 -0800
From: abapguy@yahoo.com
To: users@httpd.apache.org
Subject: [users@httpd] mod_rewrite + mod_headers :How to set Cache instructions for Rewritten .swf content only  ?



Hi Apache Experts,
I wish to set 2 Cache statements for .swf files (only) . I am rewriting using mod_rewrite and have enabled mod_headers .
My 1st attempt did not work  :

RewriteCond %{REQUEST_URI} \.(swf)$ [NC]
Header set Cache-Control "must-revalidate, proxy-revalidate"
Header set Pragma "public"
RewriteRule ^/<flash_dir>/(.*)\.swf https://<servername>/<flash_dir>/$1.swf [P,NC,L]

It seems RewriteCond is applied to the next Rewrite rule ..but the Headers are set for all subsequent Rewrite rules ..not what I wanted .
Is this the wrong way to do it ? How do I set the Headers for .swf files only ?

Regards
Daniel



 		 	   		  
_________________________________________________________________
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop