WebFaction
Community site: login faq
0
1

HI, I use "Symbolic link to static/cgi/php54 app" for my wordpress site , I set the expiry in my access file , but page speed still reporting that (No max-age or expires) for images.

my site http://www.mepanorama.com

I have this in my .access file:

<IfModule mod_headers.c>
    # No ETags, No Pragma
    Header unset Last-Modified
    Header unset Pragma
    Header unset ETag
    # Make sure proxies deliver correct content
    Header append Vary User-Agent env=!dont-vary
    # Ensure proxies deliver compressed content correctly
    Header append Vary Accept-Encoding
    Header unset Last-Modified
    Header set Expires "Fri, 04 Nov 2021 21:59:49 GMT"
</IfModule>

## EXPIRES CACHING ##
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

asked 16 Mar '13, 12:06

sundance
1749
accept rate: 0%

edited 16 Mar '13, 13:31

likebike
3366


Hello,

Your problem is that you have another .htaccess file overriding your settings.

To demonstrate this problem please view the response headers of these two images:

http://www.mepanorama.com/wp-content/uploads/2013/03/url542-314x200.jpg

http://www.mepanorama.com/url542-314x200.jpg

You can see that the first uses ETags, while the second one uses Expires headers.

If you really want to use Expires headers, you will need to add the .htaccess rules to all of the .htaccess files along the request path (in the above case, wp-content/.htaccess).

Please let me know if you have any questions.

~Christopher S. | WebFaction Support

permanent link

answered 16 Mar '13, 13:43

likebike
3366
accept rate: 28%

thank you I never knew I had .htaccess in wp-content , any way this what inside it

Order deny,allow Deny from all <files ~="" ".(xml|css|jpe?g|png|gif|js)$"=""> Allow from all </files>

you said : If you really want to use Expires headers, you will need to add the .htaccess rules to all of the .htaccess files along the request path (in the above case, wp-content/.htaccess). it sounds like you don't recommend it ? and if its good idea how to add the rules . what will be the sentence like ?

regards

permanent link

answered 16 Mar '13, 19:56

sundance
1749
accept rate: 0%

edited 16 Mar '13, 22:59

It allows access for files of a given type, images and css, you should attempt to comment it out with a '#' symbol to see if it effects the site in any way.

(16 Mar '13, 23:06) johns

Thank you , its clear now

(23 Mar '13, 15:18) sundance
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×9
×2
×1
×1

question asked: 16 Mar '13, 12:06

question was seen: 5,926 times

last updated: 23 Mar '13, 15:28

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM