• Resolved osseonews

    (@osseonews)


    Hope someone can explain how this plugin actually works because our cache keeps growing even though we are using the bare minimum needed. We have read all the FAQ and all the blog posts, but still we keep getting new files every day.
    Here is our set up:
    1. Optimize HTML Code is checked.
    2. We are not optimizing any JS. Nor are we aggregating any JS. Nothing in JS is checked off. So zero JS minification etc.
    3. We are optimizing CSS, but we are not aggregating any css nor doing anything with inline. Only thing check off for CSS is Optimize and remove Google Font.
    4. We are saving all files as static.
    5. We are using Wpengine cache, so the whole site is cached on the backend.
    6. We are using WordPress/Woocommerce and are on the latest version of each. So we have logged in users and non-logged in users.

    So what’s happening? Basically, when we started with autoptimize, we had 3 files in the cache. A day later, and now there are 27 files and 27 MB. Why are there so many files? Why does this plugin keep adding files when we don’t add any new CSS? These files appear to slow down the site. What is the point of the plugin exactly if it is not using the same minified CSS files for every user and instead recreates the CSS multiple times for multiple users? Any benefit you receive from combining and minifying the files gets lost because of the extra load from all the new files that are created for no apparent reason. How do we fix this or is this just a type of issue with this plugin?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Frank Goossens

    (@futtta)

    the short & simple explanation of how AO works (a longer version is here): it extracts the CSS (or JS, but that’s not the case in your setup), combines it into one string, calculates a hash of the string and looks for a cached version of the minified version of that string using the hash and if not found minifies the string and caches it. if anything changes the next run in the CSS, even only one character, the hash is different and the string again is minified. so basically it is not up to autoptimize to decide how many optimized CSS-files are created, it’s the specific context of a site + theme + plugins + configuration really.

    if you are not aggregating inline CSS (that option is on by default, as it only rarely causes cache issues as opposed to it’s JS counterpart, so I assume you explicitly turned it off which would be my first advice anyway), then the problem must be with one (or more) CSS-files that are changing somehow (maybe between different product-pages or on the same page but over time). some plugins load their CSS conditionally and great plugins like plugin organizer that can result in differences between CSS on different pages as well.

    the challenge will be in identifying what CSS is causing this and then to exclude that CSS from optimization. this can be done by either comparing two or more files in wp-content/cache/autoptimize/css or by looking at the HTML source of unoptimized pages (just add ?ao_noptimize=1 to the URL) and trying to spot a CSS-file that seems a possible culprit.

    so … let’s go hunt some CSS, shall we? ??

    frank

    Thread Starter osseonews

    (@osseonews)

    OK. Thanks for the quick response. Will have to look at HTML source. Also, I was thinking maybe it just pays to combine the CSS and not minimify it. If I do that using the API, would that help? I imagine that if we use the API to combine and not minify then even if the CSS of a product page changes, it won’t effect anything because the plugin won’t regenerate the CSS file, as its just combining. Is this correct?

    Plugin Author Frank Goossens

    (@futtta)

    even when not minifying AO will still cache the aggregated CSS, but it will definitively be faster at it (as minification is the most “expensive” step).

    Thread Starter osseonews

    (@osseonews)

    Thanks, so I used the code below in our functions.php file to stop minification, then deleted the cache, but whenever i look at the cached file, it is still minified. How do I stop minification of the CSS file? How to check that minification is actually turned off? The filter doesn’t appear to actually do anything.

    CODE
    —–
    add_filter(‘autoptimize_css_do_minify’,’my_ao_css_minify’,10,1);
    function my_ao_css_minify() {
    return false;
    }

    Thread Starter osseonews

    (@osseonews)

    You can ignore my last comment. We cleared the cache again and now the function used previously seems to work fine. Thanks for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Cache Growing even with Bare Minimum Set Up?’ is closed to new replies.