• Resolved tatjanaostalceva

    (@tatjanaostalceva)


    Hi! I installed Hummingbird plugin on my site, and now I need to set up browser caching, because “4 of your cache types don’t meet the recommended expiry period of 1 year”. JS, CSS, Media, IMG are these types. Hummingbird automatically detected my server type as Nginx. Now I’m offered to copy generated code to some place, which I don’t know how to find. Here is the instruction:
    1.Copy the generated code into your nginx.conf usually located at /etc/nginx/nginx.conf or /usr/local/nginx/conf/nginx.conf
    2.Add the code above to the http or inside server section in the file.
    3.Restart NGINX.
    4.Re-check expiry status.
    My questions are:
    1. Do I need to paste this code twise, first time to nginx.conf, second time to the http or inside server section?
    2. Could someone please explain in detail, where exactely I need to look for the place to paste the code? I am not a site developer, I really have no idea what to do, although I have some experience pasting code, but I had detailed instructions.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @tatjanaostalceva ,

    1. Do I need to paste this code twise, first time to nginx.conf, second time to the http or inside server section?

    Http and server section is part of the nginx.conf. When you open then nginx.conf file you will see those parts:
    https://www.nginx.com/resources/wiki/start/topics/examples/full/
    So depending on how your nginx.conf looks you will paste that code between:

    http { 
    
    }

    or

      server {
    
    }

    If you still have issues with that I suggest contacting your hosting provider and ask them to help.

    kind regards,
    Kasia

    Thread Starter tatjanaostalceva

    (@tatjanaostalceva)

    Okay, now I understand that I need to paste this code only once. but could you please explain step by step, click by click, what I need to open, and where I open it, in wordpress dashboard, or in my hosting, and what kind of document I should look for, and where exactely do I put this code? Between tags and brackets – it can be a large space, I need to know the line.

    Thread Starter tatjanaostalceva

    (@tatjanaostalceva)

    I reached to my server support and they told me that your plugin supposes to change settings for all server, which is impossible, because they provide hosting for many sites and they can’t impose my private settings to all other sites. Is this true, do you want me to change settings for the whole server?

    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @tatjanaostalceva

    I hope you are doing well!

    The code that is provided in Hummingbird is a widely used code to enable Browser Caching and it needs to be added to a server’s configuration file, which is only one. When it will be added to the server’s config file, it will apply for the whole server. If you have other sites n this server, other sites will have Browser Caching enabled too, if this is how your server is setup.

    You can add the code inside the server section in the file. So for example, look for a line that starts with server:

    server {
        listen 80 default_server;
        listen [::]:80 default_server;

    Add the given code inside the existent server block.

    Based on your reply though, it looks like you are on shared hosting and do not have access to the server’s config file. If that is the case, please contact your hosting provider and ask them to enable Laverge Browser caching for your site.

    Kind regards,
    Nastia

    Thread Starter tatjanaostalceva

    (@tatjanaostalceva)

    Well, my server support refused to make changes to their settings, but they offered me to set up browser caching through hp.access file, adding there the following code:
    ## EXPIRES CACHING ##
    <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 text/html “access 1 month”
    ExpiresByType application/pdf “access 1 month”
    ExpiresByType text/x-javascript “access 1 month”
    ExpiresByType application/x-shockwave-flash “access 1 month”
    ExpiresByType image/x-icon “access 1 year”
    ExpiresDefault “access 1 month”
    </IfModule>
    ## EXPIRES CACHING ##
    I changed all terms for 1 year where it was set up for 1 month, and after I pressed re-check status, your plugin showed the required settings were working. Could you please check it on your side, to make sure that there are no mistakes?

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @tatjanaostalceva

    Yes, the snippet looks good! :thumbup:

    Take care,
    Dimitris

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how to set up browser caching’ is closed to new replies.