• Resolved travelwithbrandon

    (@travelwithbrandon)


    Hi there,

    Thanks for the support. I have a different method in place to cache but I found Hummingbird and wanted to give it a try. I’m not sure why this particular cache setting isn’t working but here’s what I’m dealing with…

    I have Apache and expiry set to 1 year for all file types. When I load the browser caching page, it has all of the items set to ‘Disabled’. When I refresh, it says ‘false’. I should add that it has in fact updated my .htaccess file with what I believe would be correct information. I changed the file permissions from 644 to 777 temporarily to allow for this change, though I’m not sure if I must leave it as some form of write to allow updates to this in the future. I’m not using cloudflare or any CDN at the moment.

    Here is what was written into my .htaccess:

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A0
    
    <FilesMatch "\.(txt|xml|js)$">
    ExpiresDefault A15552000
    </FilesMatch>
    
    <FilesMatch "\.(css)$">
    ExpiresDefault A15552000
    </FilesMatch>
    
    <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|svg)$">
    ExpiresDefault A15552000
    </FilesMatch>
    
    <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
    ExpiresDefault A15552000
    </FilesMatch>
    </IfModule>
    
    <IfModule mod_headers.c>
      <FilesMatch "\.(txt|xml|js)$">
       Header set Cache-Control "max-age=15552000"
      </FilesMatch>
    
      <FilesMatch "\.(css)$">
       Header set Cache-Control "max-age=15552000"
      </FilesMatch>
    
      <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|svg)$">
       Header set Cache-Control "max-age=15552000"
      </FilesMatch>
    
      <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
       Header set Cache-Control "max-age=15552000"
      </FilesMatch>
    </IfModule>

    Here is what the manual option tells me I should enter manually, if I wish:

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A0
    
    <FilesMatch "\.(txt|xml|js)$">
    ExpiresDefault A31536000
    </FilesMatch>
    
    <FilesMatch "\.(css)$">
    ExpiresDefault A31536000
    </FilesMatch>
    
    <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|svg)$">
    ExpiresDefault A31536000
    </FilesMatch>
    
    <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
    ExpiresDefault A31536000
    </FilesMatch>
    </IfModule>
    
    <IfModule mod_headers.c>
      <FilesMatch "\.(txt|xml|js)$">
       Header set Cache-Control "max-age=31536000"
      </FilesMatch>
    
      <FilesMatch "\.(css)$">
       Header set Cache-Control "max-age=31536000"
      </FilesMatch>
    
      <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|svg)$">
       Header set Cache-Control "max-age=31536000"
      </FilesMatch>
    
      <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
       Header set Cache-Control "max-age=31536000"
      </FilesMatch>
    </IfModule>

    You can notice some differences between the two, and I’m not quite sure why. Thanks again, I’m that I can use Hummingbird on all of my client’s sites if we can get it working here.

    Thanks

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello @travelwithbrandon

    I hope you are doing well!

    The difference between these two is a max-age. The Browser caching is something that is handled by the server and Hummingbird applies the required rules via .htaccess in order to get the server to enable it. Please make sure the mod_expires module is enabled on your host.

    If this will not help, please contact your hosting provider, most likely browser caching can’t be enabled due to some server-side restriction.

    Kind regards,
    Nastia

    Thread Starter travelwithbrandon

    (@travelwithbrandon)

    Thank you for the response. Do you have a tutorial for how to enable this on a DigitalOcean droplet? That would be very helpful if so, as I’ve never explored with this module before.

    Thanks!

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @travelwithbrandon ,

    Please check this forum question https://www.digitalocean.com/community/questions/cant-install-mod_expires-getting-internal-server-error-when-enable-it

    We don’t have a tutorial on how to enable this module on DO.

    kind regards,
    Kasia

    Thread Starter travelwithbrandon

    (@travelwithbrandon)

    Hi, thanks for that – it was helpful. I’ve enabled the module on DO and now I’m presented with a list of things that I can enable. Which would be relevant for Hummingbird?

    $ sudo a2enmod
    Your choices are: access_compat actions alias allowmethods asis auth_basic auth_digest auth_form authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authnz_fcgi authnz_ldap authz_core authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex buffer cache cache_disk cache_socache cern_meta cgi cgid charset_lite data dav dav_fs dav_lock dbd deflate dialup dir dump_io echo env expires ext_filter file_cache filter headers heartbeat heartmonitor http2 ident imagemap include info lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat ldap log_debug log_forensic lua macro mime mime_magic mpm_event mpm_prefork mpm_worker negotiation php7.2 proxy proxy_ajp proxy_balancer proxy_connect proxy_express proxy_fcgi proxy_fdpass proxy_ftp proxy_hcheck proxy_html proxy_http proxy_http2 proxy_scgi proxy_wstunnel ratelimit reflector remoteip reqtimeout request rewrite sed session session_cookie session_crypto session_dbd setenvif slotmem_plain slotmem_shm socache_dbm socache_memcache socache_shmcb speling ssl status substitute suexec unique_id userdir usertrack vhost_alias xml2enc

    I’ve already enabled headers and expires

    Thanks!

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @travelwithbrandon ,

    I’ve already enabled headers and expires

    That should be enough. mod_expires needs to be enabled for Hummingbird.

    kind regards,
    Kasia

    Thread Starter travelwithbrandon

    (@travelwithbrandon)

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unable to Activate Browser Caching on DigitalOcean’ is closed to new replies.