Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem Enabling Browser Caching

Discussion in 'Workarounds and Optimization' started by jazee, Sep 15, 2017.

  1. jazee

    jazee Well-Known Member

    Joined:
    Jan 12, 2015
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Both Google Pagespeed Insights and GTMetrix are telling me my Wordpress site does not have browser caching enabled. I added the following to the .htaccess file in public_html and it makes no difference!

    <filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    Header set Cache-Control "max-age=84600, public"
    </filesMatch>

    <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/javascript "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"
    </IfModule>

    Is there a common WHM/Cpanel issue that could be preventing the caching from being enabled?
     
  2. Eminds

    Eminds Well-Known Member

    Joined:
    Nov 10, 2016
    Messages:
    211
    Likes Received:
    13
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Do you have any caching plugin installed with your wordpress installation ? plugins like W3Total Cache can fulfill your requirements.
     
  3. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,615
    Likes Received:
    51
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    is mod_deflate installed on your system
    verify via command line

    httpd -t -D DUMP_MODULES | grep deflate_module
    ea-apache24-mod_deflate
    if its not installed
    for EA4
    yum install ea-apache24-mod_deflate

    if still using EA3
    use easyapache
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you reproduce the same test results with a test page that's not part of your WordPress installation? If not, then you may want to look into WordPress plugins that utilize browser caching.

    Thank you.
     
Loading...

Share This Page