• Resolved jtan99

    (@jtan99)


    My GTMetrix report is telling me that I have a bunch of resources that I need to leverage browser caching for. I adjusted my .htaccess to the following (see below) but it hasn’t changed the page speed results:

    
    
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_expires.c>
      ExpiresActive On
    
      # Images
      ExpiresByType image/jpeg "access plus 1 year"
      ExpiresByType image/gif "access plus 1 year"
      ExpiresByType image/png "access plus 1 year"
      ExpiresByType image/webp "access plus 1 year"
      ExpiresByType image/svg+xml "access plus 1 year"
      ExpiresByType image/x-icon "access plus 1 year"
    
      # Video
      ExpiresByType video/webm "access plus 1 year"
      ExpiresByType video/mp4 "access plus 1 year"
      ExpiresByType video/mpeg "access plus 1 year"
    
      # Fonts
      ExpiresByType font/ttf "access plus 1 year"
      ExpiresByType font/otf "access plus 1 year"
      ExpiresByType font/woff "access plus 1 year"
      ExpiresByType font/woff2 "access plus 1 year"
      ExpiresByType application/font-woff "access plus 1 year"
    
      # CSS, JavaScript
      ExpiresByType text/css "access plus 1 month"
      ExpiresByType text/javascript "access plus 1 month"
      ExpiresByType application/javascript "access plus 1 month"
    
      # Others
      ExpiresByType application/pdf "access plus 1 month"
      ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
    </IfModule>
    <ifModule mod_headers.c>
    Header set X-Endurance-Cache-Level "2"
    </ifModule>
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php73” package as the default “PHP” programming language.
    <IfModule mime_module>
      AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit
    

    I currently use Bluehost and I know that the following section in my .htaccess is from Bluehosts’ built in caching system:

    
    <ifModule mod_headers.c>
    Header set X-Endurance-Cache-Level "2"
    </ifModule>
    <IfModule mod_rewrite.c>
    

    Could this be overriding my caching settings? If so, should I just disable Bluehosts’ built-in caching system completely and install a caching plugin like WP Rocket?

    Thanks!

    • This topic was modified 5 years, 5 months ago by Yui. Reason: please use CODE button for code formatting

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    I currently use Bluehost and I know that the following section in my .htaccess is from Bluehosts’ built in caching system… Could this be overriding my caching settings?

    Your best bet is to ask Bluehost.

    Also review these help guides with some useful optimization tips:

    Optimization


    https://www.wpbeginner.com/wordpress-performance-speed/

    As @t-p said, ask Bluehost but they are providing an Nginx proxy out front of their Apache server… take advantage of it.

    I’d also add the W3Total or the WP Super Cache to that to control all that cache’s and that proxy’s features.

    One or the other of those cache plugins will also manage that browser cache on your client’s end and take the burden off your manual htaccess tweaks…

    That’s dang good caching at that point.

    I’d also use the speed analysis sites to see where I might improve things as I go along but for performance, you can’t beat ‘more horsepower’… tweaks and tricks are great but if the horsepower ain’t there then you’ll always be constrained by the hardware.

    One more thing I’d do is get on Cloudflare… the free Cloudflare service will run well if your server can keep up with Cloudflare’s needs and you get one of the best DNS servers with Cloudflare plus they’ll throw in a free SSL if you need it.

    And if your server can’t keep up with the free Cloudflare tier then you need to add horsepower on your server end.

    That’s how I see things anyway.

    Thread Starter jtan99

    (@jtan99)

    Great thank you, that’s helpful!

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

The topic ‘Leverage Browser Caching – Bluehost’ is closed to new replies.