Solved

Cannot Add Expire Header YSLOW

Posted on 2010-11-20
3
637 Views
Last Modified: 2012-05-10
Dear all,

How to add expire header via htaccsess successfully. I have tried methods such as.

( add to my htaccsess)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/x-icon A2592000
</IfModule>                                                              

but this code simply doesn't work. I try another method

# turn on the module for this directory
ExpiresActive on
# set default
ExpiresDefault "access plus 24 hours"
ExpiresByType image/jpg "access plus 1 months"
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
ExpiresByType text/css "access plus 1 months"
ExpiresByType text/javascript "access plus 1 months"
ExpiresByType application/javascript "access plus 1 months"
ExpiresByType application/x-shockwave-flash "access plus 1 months"

this method give me error on my wibesite ( error 500 )

I  try another method
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "access plus 1 weeks"
Header set Cache-Control "public"
</FilesMatch>
 and doesn't work as well

Could you please help me how to add expire header .

Thanks before
lie

0
Comment
Question by:lieYawen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 34185966
You need to load expires module (uncomment it in httpd.conf)
0
 

Author Closing Comment

by:lieYawen
ID: 34192773
Hi gheist,

Thanks a lot for your help. Yes you're right. but unfortunately  my web hosting doesn't  support Mod_Expire for shared hosting.

Regards
Lie

0
 
LVL 62

Expert Comment

by:gheist
ID: 34193072
Have you asked?
You can push headers from e.g php pages, but server provisions are better.
Your ifmodule directives will adapt your provider loading the module.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
First of all, we will need Jumi component or Sourcerer plugin for this to work. We need either of these because the main focus here is custom development outside of the standard modules or articles within Joomla. You can find Jumi here...it's my …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question