ROL4ND909/tattoolefthand/gh-pages/.htaccess - Htaccess File


AddDefaultCharset UTF-8

#webfont MIME encoding. Google Chrome likes that.
AddType application/ .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff

# Set Expires Headers
<ifModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access 1 month"

    # cache.appcache needs re-requests in FF 3.6
    ExpiresByType text/cache-manifest "access 0 seconds"

    # Your document html
    ExpiresByType text/html "access 1 hour"

    # Data
    ExpiresByType text/xml "access 0 seconds"
    ExpiresByType application/xml "access 0 seconds"
    ExpiresByType application/json "access 0 seconds"

    # RSS feed
    ExpiresByType application/rss+xml "access 1 hour"

    # Favicon (cannot be renamed)
    ExpiresByType image/x-icon "access 1 month"

    # Media: images, video, audio
    ExpiresByType image/gif "access 1 month"
    ExpiresByType image/png "access 1 month"
    ExpiresByType image/jpg "access 1 month"
    ExpiresByType image/jpeg "access 1 month"
    ExpiresByType video/ogg "access 1 month"
    ExpiresByType audio/ogg "access 1 month"
    ExpiresByType video/mp4 "access 1 month"
    ExpiresByType video/webm "access 1 month"

    # HTC files  (css3pie)
    ExpiresByType text/x-component "access 1 month"

    # Webfonts
    ExpiresByType font/truetype "access 1 year"
    ExpiresByType font/opentype "access 1 year"
    ExpiresByType application/x-font-woff "access 1 year"
    ExpiresByType image/svg+xml "access 1 year"
    ExpiresByType application/ "access 1 year"

    # CSS and JavaScript
    ExpiresByType text/css "access 1 year"
    ExpiresByType application/javascript "access 1 year"
    ExpiresByType text/javascript "access 1 year"

<ifModule mod_headers.c>
    #Set default cache control header to 1 WEEK
    Header unset Cache-Control
    Header set Cache-Control "max-age=604800, public, must-revalidate"
    Header set Connection keep-alive

    # Force no caching for dynamic files like PHP scripts since it causes troubles with lots of content management systems like Typo3 or Joomla.
    <FilesMatch ".(php|cgi|pl|htm|html)$">
        <ifModule mod_expires.c>
            ExpiresDefault A0
        Header unset Cache-Control
        Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0, pre-check=0, post-check=0"

    # 1 WEEK
    <FilesMatch ".(css|js|xml)$">
        Header unset Cache-Control
        Header set Cache-Control "max-age=604800, public, must-revalidate"

    # 1 MONTH
    <FilesMatch ".(avi|mov|ppt|doc|docx|xls|xlsx|ppt|pptx|mp3|wmv|wav|ico|pdf|flv|jpg|jpeg|png|gif|swf|txt)$">
        ### By disabling "Last-Modified" globally and ETag and setting an expiration to now+xx days these filetypes
        ### will not be revalidated again once they're downloaded. This means that there won't be even any re-request by the browser on these files
        ### until the originally set expiration date is set. This represents a large optimization potential because it minimizes server requests dramatically
        ### but it might lead to confusion at the development stage. Thus for development you should disable all caching using the options below.
        ### Nevertheless if you use the browsers' reload or clear cache functions you can force loading the data from server.
        Header unset Cache-Control
        Header set Cache-Control "max-age=2592000, public"

        #Since we're not revalidating here no ETag is required
        #FileETag None
        #Header unset ETag

    #This is what Google wants
    <FilesMatch ".(js|css|xml|gz)$">
        Header append Vary: Accept-Encoding
        Header set Cache-Control "max-age=604800, public, must-revalidate"

    # add entity tag
    FileETag MTime Size

    SetOutputFilter DEFLATE
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/x-javascript text/css font/truetype

    Header unset Last-Modified
    Header unset Pragma

# Deflate Compression by FileType
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE x-font/otf x-font/ttf x-font/eot

# gzip Compression if availiable
<IfModule mod_gzip.c>
    mod_gzip_on                     Yes
    mod_gzip_dechunk                Yes
    mod_gzip_keep_workfiles         No
    mod_gzip_minimum_file_size      300
    mod_gzip_maximum_file_size      1000000
    mod_gzip_maximum_inmem_size     1000000
    mod_gzip_item_include file      .(html?|txt|css|js|php|pl|xml)$
    mod_gzip_item_include handler   ^cgi-script$
    mod_gzip_item_include mime      ^text/.*
    mod_gzip_item_include mime      ^application/javascript.*
    mod_gzip_item_include mime      ^application/x-javascript.*

    # Exclude old browsers and images since IE has trouble with this
    mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4..*["
    mod_gzip_item_exclude mime      ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

<IfModule pagespeed_module>
    ModPageSpeed on
    ModPagespeedRewriteLevel  CoreFilters
    ModPagespeedEnableFilters prioritize_critical_css
    ModPagespeedEnableFilters defer_javascript
    ModPagespeedEnableFilters sprite_images
    ModPagespeedEnableFilters convert_png_to_jpeg,convert_jpeg_to_webp
    ModPagespeedEnableFilters collapse_whitespace,remove_comments

<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 application/x-javascript "access 1 month"
  ExpiresByType application/x-shockwave-flash "access 1 month"
  ExpiresByType image/x-icon "access 1 year"
  ExpiresDefault "access 2 days"

On Github License


Download PDF of Htaccess file
DEFLATE, no-cache, Pragma