• Resolved ac1643

    (@ac1643)


    Hi,

    I intend to use the Falcon Engine feature of your plugin and know that it modifies the htaccess file. I’ve also found some code which is recommended to be added to the htaccess file in order to speed up page load times. Could you please tell me if this would complement the falcon engine changes, replicate them or interfere with them. What is the optimal set up? The code is:

    # BEGIN GZIP COMPRESSION
    <IfModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </IfModule>
    # END GZIP COMPRESSION

    # BEGIN DEFLATE COMPRESSION
    <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE “application/atom+xml” \
    “application/javascript” \
    “application/json” \
    “application/ld+json” \
    “application/manifest+json” \
    “application/rdf+xml” \
    “application/rss+xml” \
    “application/schema+json” \
    “application/vnd.geo+json” \
    “application/vnd.ms-fontobject” \
    “application/x-font-ttf” \
    “application/x-javascript” \
    “application/x-web-app-manifest+json” \
    “application/xhtml+xml” \
    “application/xml” \
    “font/eot” \
    “font/opentype” \
    “image/bmp” \
    “image/svg+xml” \
    “image/vnd.microsoft.icon” \
    “image/x-icon” \
    “text/cache-manifest” \
    “text/css” \
    “text/html” \
    “text/javascript” \
    “text/plain” \
    “text/vcard” \
    “text/vnd.rim.location.xloc” \
    “text/vtt” \
    “text/x-component” \
    “text/x-cross-domain-policy” \
    “text/xml”
    </IfModule>
    # END DEFLATE COMPRESSION

    # START EXPIRES CACHING #
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg “access plus 3 months”
    ExpiresByType image/jpeg “access plus 3 months”
    ExpiresByType image/gif “access plus 3 months”
    ExpiresByType image/png “access plus 3 months”
    ExpiresByType application/x-font-woff “access plus 3 months”
    ExpiresByType text/css “access plus 1 month”
    ExpiresByType application/pdf “access plus 1 month”
    ExpiresByType application/javascript “access 1 month”
    ExpiresByType text/x-javascript “access plus 1 month”
    ExpiresByType application/x-shockwave-flash “access plus 1 month”
    ExpiresByType image/x-icon “access plus 3 months”
    ExpiresDefault “access plus 2 days”
    </IfModule>
    # END EXPIRES CACHING #

    Many thanks for a great plugin

    Ad

    https://ww.wp.xz.cn/plugins/wordfence/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WFMattR

    (@wfmattr)

    Falcon saves gzipped copies of files to serve directly — it’s possible that this might conflict with the GZIP and DEFLATE code that you’re planning to use. These two might work ok with Falcon if you exclude the “text/html” mime type in the code above.

    You can test if there is a conflict by adding the code to .htaccess, then clearing Falcon’s cache (using the button on the Performance Setup page), and visiting a few pages multiple times in a different browser, without logging into the site. (Private or incognito browser windows should work too.) If there is a conflict, pages would generally look like a bunch of random characters the second time you viewed a page, but clearing the cache again and removing the .htaccess code would make it back to normal.

    The “Expires” lines should work fine with Falcon. Just be careful in general, if you often change your CSS code or have custom javascript, some browsers will keep the cached copy and may not see your changes as soon as you would like.

    -Matt R

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding page speed code alongside Falcon Engine code in htaccess file’ is closed to new replies.