How to set Expire Headers for images in Litespeed

Discussion in 'Install/Configuration' started by ltd82, Jul 13, 2010.

  1. ltd82

    ltd82 New Member

    I need help with setting up expire headers for images. I have the following settings in the LSWS Admin Console.

    Code:
    Enable Expires	Yes
    Expires Default	Not Set
    Expires By Type	image/*=A604800, text/css=A604800, application/x-javascript=A604800, application/javascript=A604800
    
    I checked through google's pagespeed tool in firefox and it says (expiration not specified) for all the images.

    I have also tried to specify image type but still the same result.

    Code:
    Enable Expires	Yes
    Expires Default	Not Set
    Expires By Type	image/gif=A604800, image/png=A604800, image/jpg=A604800, text/css=A604800, application/x-javascript=A604800, application/javascript=A604800
    
    Can somebody please point what I need to do in addition to above steps.
  2. NiteWave

    NiteWave Administrator

    if a image file is streamed by php, php should set the Expire header;

    if it's static image file and served by lsws, should have the expire header.

    you can check litespeedtech.com 's image header in pagespeed, can see expire header is there.
  3. ltd82

    ltd82 New Member


    Sorry I missed you. I'm not good at it but I'm learning fast :) I'm using wordpress and have configured a subdomain for the media. Now the images (which do not have expire headers) are being served from the subdomain, does that still count as streaming through php ?

    Please advise.
  4. NiteWave

    NiteWave Administrator

    can you post the URL here(or PM me) ? I'd check to get more info.
  5. ltd82

    ltd82 New Member

    Thanx Nitewave, URL and other details are sent to your PM.
  6. ltd82

    ltd82 New Member

    create or modify your .htaccess file and add this line
    ExpiresActive On

    This was a quick fix suggested by Nitewave.

    I am working on fixing expire headers, cookie less domain and other pagespeed and yslow instructions. I will post my findings and fixes in a couple of days here.

Share This Page