• Resolved mundkurgopi1955

    (@mundkurgopi1955)


    Hello,

    Is it necessary to add the following codes to Leverage Browser Caching in WordPress along with the Super Page Cache for Cloudflareplugin:

    #Customize expires cache start – adjust the period according to your needs
    <IfModule mod_expires.c>
    FileETag MTime Size
    AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
    ExpiresActive On
    ExpiresByType text/html “access 600 seconds”
    ExpiresByType application/xhtml+xml “access 600 seconds”
    ExpiresByType text/css “access 1 month”
    ExpiresByType text/javascript “access 1 month”
    ExpiresByType text/x-javascript “access 1 month”
    ExpiresByType application/javascript “access 1 month”
    ExpiresByType application/x-javascript “access 1 month”
    ExpiresByType application/x-shockwave-flash “access 1 month”
    ExpiresByType application/pdf “access 1 month”
    ExpiresByType image/x-icon “access 1 year”
    ExpiresByType image/jpg “access 1 year”
    ExpiresByType image/jpeg “access 1 year”
    ExpiresByType image/png “access 1 year”
    ExpiresByType image/gif “access 1 year”
    ExpiresDefault “access 1 month”

    </IfModule>
    #Expires cache end

    # BEGIN Cache-Control Headers

    <IfModule mod_expires.c>
    <IfModule mod_headers.c>
    <filesMatch “\.(ico|jpe?g|png|gif|swf)$”>
    Header append Cache-Control “public”
    </filesMatch>
    <filesMatch “\.(css)$”>
    Header append Cache-Control “public”
    </filesMatch>
    <filesMatch “\.(js)$”>
    Header append Cache-Control “private”
    </filesMatch>
    <filesMatch “\.(x?html?|php)$”>
    Header append Cache-Control “private, must-revalidate”
    </filesMatch>
    </IfModule>
    </IfModule>

    Turn Etags off

    <IfModule mod_headers.c>
    Header unset ETag
    </IfModule>
    FileETag None

    Kindly guide me as I am a novice to all this.

    Thank you,

    Gopi Mundkur

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    please remove all the .htaccess code you have mentioned above from your htaccess file as all of these are just useless. Once you have deleted all those code you have mentioned above that are related to static file browser caching, then save your htaccess file and go inside this plugin settings.

    There under the Cache tab, enable the option Add browser caching rules for static assets and update the settings. Screenshot: https://i.imgur.com/HeD7CCZ.jpeg
    The plugin will automatically add the necessary htaccess rules that are needed for static file caching.

    Also make sure your have force purge the whole cache after doing this.

    Thread Starter mundkurgopi1955

    (@mundkurgopi1955)

    Thank you, Mr. Saumya Majumder. I have done as instructed.

    When should the fallback cache be used? When and how often should Purge Cache be done?

    Also, I request you to kindly check if my two websites are working fine with the plugin: https://tanzania-wildlife-safaris.com and https://sri-lanka-tours-online.com

    Thank you for your quick response and excellent support!

    Plugin Contributor iSaumya

    (@isaumya)

    When should fallback cache be used?

    – If you have low to medium traffic on your site, you can enable fallback cache.

    > Checking site tanzania-wildlife-safaris.com

    1. For the main HTML request the cache-control header value is not being managed by this plugin and instead it is being managed by either some other caching plugin or server level caching solution or some htaccess rule. Whatever the case is, please remove that to ensure the cache-control header value is always managed by this plugin.

    Screenshot: https://i.imgur.com/tCxJ36M.jpeg

    As you can see in the screenshot above, the value of cache-control and x-wp-cf-super-cache-cache-control doesn’t match. But if the plugin was managing the cache control header they should have matched.

    I see the exact same matter with sri-lanka-tours-online.com as well.

    Thread Starter mundkurgopi1955

    (@mundkurgopi1955)

    Thank you, once again. I have removed the .htaccess rule.

    Yes, my websites have low to medium traffic. Therefore, If I enable the fallback cache, I see other settings below it:

    1). Use cURL
    2). Automatically purge the fallback cache when Cloudflare cache is purged
    3). Fallback cache TTL
    4). Prevent the following URIs to be cached
    5). Bypass fallback cache when these cookies are present in the request packet
    6). Save response headers
    7). Prevent to cache URLs without trailing slash
    8). Purge fallback cache

    What to do with the above settings, kindly advise if they are to be set or if are they to be left as they are.

    Plugin Contributor iSaumya

    (@isaumya)

    Just use the default seetings. No need to make any special changes

    Thread Starter mundkurgopi1955

    (@mundkurgopi1955)

    Thank you so much, Mr. Saumya Majumder. Best regards.

    Plugin Contributor iSaumya

    (@isaumya)

    If you like the plugin, please do consider sharing a review in the review section.

    Thread Starter mundkurgopi1955

    (@mundkurgopi1955)

    Yes, it is an awesome plugin! I have shared my review.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Leverage Browser Caching’ is closed to new replies.