• Resolved boundforhome

    (@boundforhome)


    I’ve got one single .css file that simply doesn’t seem to get minified by Autoptimize, and I can’t figure it out!

    It still seems to be loading this file from the original source:

    /wp-content/themes/jamesday-theme/theme-files/public/css/style.css

    …rather than any sort of /cache/autoptimize/ folder.

    I suspect it’s something to do with the way this theme is currently working, clearly this .css file is loaded ‘differently’.

    If I enable the “Aggregate CSS-files?” options, I end up with a bunch of CSS files not loaded at all – the website breaks in a major way.

    Is there:
    1) a way to force a particular file to be minified?
    2) something that could be conflicting with this? I’ve turned off WP Super Cache, still happening.

    Not quite sure what I’m misunderstanding here. It’s a 300Kb file, so would make a ~250Kb improvement if I could get it minified!

    Thanks so much,

    Jason

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    typically if AO does not optimize a file when it cannot read the original file from the filesystem for whatever reason.

    hard to say what exactly is going wrong, but WP Super Cache is a great companion of AO, so that’s most certainly not it.

    do you see anything relevant in the PHP-errorlog?

    Thread Starter boundforhome

    (@boundforhome)

    Thanks @optimizingmatters – I will check out the PHP errorlog right now, hadn’t considered that.

    Also, worth noting it’s not quite “one single file”, it’s actually 3 files, all of which are in the /theme-files/public/ folder, so there’s something weird about how they’re loaded, perhaps.

    Investigating. Thanks.

    Thread Starter boundforhome

    (@boundforhome)

    … nothing untoward in the PHP error log. There’s an Aq_Resize.process() error and something for some Flothemes PHP that fails. That’s it. ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    but wp-content/themes/jamesday-theme/theme-files/public/css/vendor.css and wp-content/themes/jamesday-theme/style.css (both in the same folder) are indeed minified and are referenced as /wp-content/cache/autoptimize/autoptimize_single_<hash-here>.php so the problem is specifically and only with wp-content/themes/jamesday-theme/theme-files/public/css/style.css.

    Now I looked at that specific file and it is pretty huge (1.5MB!) because of an base64-encode sourcemap that is embedded in the stylesheet itself, which (a) is only useful for development purposes (b) is adding _a lot_ of weight and (c) is not the way sourcemaps are usually added. My gut feeling is that this big embedded sourcemap is what is causing the CSS minifier to fail and causes AO to leave the file in there un-optimized.

    So I would suggest to either reach out to the theme developers on this and ask how the sourcemap can be disabled OR to remove the sourcemap from the CSS-file yourself?

    frank

    Thread Starter boundforhome

    (@boundforhome)

    Amazing @optimizingmatters – thank you Frank, that sort of investigation is going way beyond what I expect, and I appreciate it so much. I wish I had considered doing this myself. Thank you. Will figure out exactly what that means and why it’s there!

    • This reply was modified 4 years, 8 months ago by boundforhome.
    Thread Starter boundforhome

    (@boundforhome)

    Amazing @optimizingmatters – that made all the difference. I simply removed that whole base64-encode sourcemap and it just works as expected. It was that simple, and that complicated. Weird.

    Thread Starter boundforhome

    (@boundforhome)

    Thanks @optimizingmatters – are you able to remove the “The page I need help with: ” from the original post? Already getting spam emails about ‘solutions’ that I don’t need.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Afraid I can’t no, don’t have administrator rights here on the forum.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘One particular CSS file that is not being Optimised and Minified’ is closed to new replies.