Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Cannot Add Expire Header YSLOW

Posted on 2010-11-20
3
Medium Priority
?
639 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 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

715 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