Header Caching and Cache Control Improve with YSlow with .htaccess

Discussion in 'Search Engine Optimization' started by adminenforums, August 3, 2017.

  1. adminenforums

    adminenforumsAdministratorStaff Member

    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    2
    How to Header Caching and Cache Control Improve with YSlow with the .htaccess file?

    ### HEADER CACHING
    <ifModule mod_headers.c>
    # YEAR
    <FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$">
    Header set Cache-Control "max-age=29030400"
    </FilesMatch>
    # WEEK
    <FilesMatch "\.(js|css|swf)$">
    Header set Cache-Control "max-age=604800"
    </FilesMatch>
    # 45 MIN
    <FilesMatch "\.(html|htm|txt)$">
    Header set Cache-Control "max-age=2700"
    </FilesMatch>
    </ifModule>

    # BEGIN Cache Control

    Header set Expires "Day, Date Month(word) YYYY 20:00:00 GMT"
    Header unset ETag
    FileETag None

    #END Cache Control
     

Share This Page