[Solved] Please help me in setting up expire headers.

Discussion in 'General' started by kan3, Feb 11, 2011.

  1. kan3

    kan3 New Member

    Hello,

    Please kindly help me in setting up the expire headers.


    I want expire headers for,

    text/css
    text/javascript
    application/javascript
    application/x-javascript
    application/x-shockwave-flash
    image/gif
    image/jpg
    image/jpeg
    image/png
    image/ico
    image/icon

    I want to set the period to 7 days.


    Thank you.
  2. NiteWave

    NiteWave Administrator

    admin console->Server->General->Expires Settings->Expires By Type
  3. kan3

    kan3 New Member

    Thank you for your swift reply.

    Will this be correct syntax?


    text/css=A604800, text/javascript=A604800, application/javascript=A604800, application/x-javascript=A604800, application/x-shockwave-flash=A604800, image/gif=A604800, image/jpg=A604800, image/jpeg=A604800, image/png=A604800, image/ico=A604800, image/icon=A604800



    Thank you.
  4. kan3

    kan3 New Member

    Ok I've added the above line.

    However static content is still not being cached. Please help.


    Thank you.
  5. webizen

    webizen New Member

    Please post some example in question here.
  6. kan3

    kan3 New Member

    Results:
    [​IMG]

    Expire settings:
    [​IMG]

    Gzip Settings
    [​IMG]

    Mime Settings:
    [​IMG]

    Thank you.
  7. NiteWave

    NiteWave Administrator

    in
    GZIP Compression ->
    Compressible Types,

    please remove "image/*", and restart lsws
  8. kan3

    kan3 New Member

    Nitewave thank your for helping. But it's still same. I removed image/* like you said.


    Thank you.
  9. NiteWave

    NiteWave Administrator

    the server's expire setting can be overridden by vhost or .htaccess or php script

    no problem found on the setting you posted.

    please check .htaccess or httpd.conf, if

    ExpiresActive off

    exists.
  10. kan3

    kan3 New Member

    This is what I saw in httpd.conf,

    <IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-gzip .tgz
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi
    AddHandler type-map var
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddType video/x-ms-asf .avi
    AddType video/mpeg .mpg
    AddType video/mpeg .mpeg
    AddType video/quicktime .mov
    AddType video/x-ms-wmv .wmv
    </IfModule>


    Does this helps or should I post the whole httpd.conf file?

    Thank you.
  11. webizen

    webizen New Member

    Please add the following directive in your httpd.conf or .htaccess.

    ExpiresActive On
  12. kan3

    kan3 New Member

    That fixed it.

    Thank you very much.
  13. NiteWave

    NiteWave Administrator

Share This Page