Archived topic
Dynamic CSS Print Method conflict with Autoptimize plugin
13 replies · Started by Clayton on October 26, 2020
Hey guys,
I'm using Autoptimize to help cache and minify CSS HTML and Javascript. It works well but there does seem to be a conflict. When I have the External File option chosen for the Dynamic CSS Print Method option it doesn't update. With Autoptimize deactivate the external file option seems to work fine.
Since Autoptimize is such a popular option for caching and minification with over a million installs I thought it was worth checking on this to see if there is something to be done.
Hi there,
what doesn't update ? Changes made in the Customizer ?
Let me know
Yes. For example the color of the footer bar or the wrapper width.
Have you tried clearing the autoptimize cache after making those changes?
Personally i never develop or customize with a cache plugin enabled as its bound to cause a headache.
Yes, I have cleared the cache. I try not to as well but some changes need to be made after the fact. Okay, well since I know what’s causing it I can avoid it but I wanted to let you know that the external css print method seems to be conflictingz
Strange, I would have thought that Autoptimize would clear its cache whenever changes are made (Customizer saved etc..).
We'll look into whether or not this is something we can fix.
That's a good point. I'll double check with them now that I know what the specific conflict is and maybe that can do something about it on their end. By the way really loving GP 3 and GB.
Figured it out. By default Autoptimize excludes the wp-content/uploads directory which is where the external CSS file is stored by GeneratePress. I've removed that exclusion rule and it all seems to be working as expected. Just wanted to post here just in case anyone else runs into the same issue.
Ah, thanks for letting us know! Really appreciate it :)
Thanks. I had the same issue. Removing ,wp-content/uploads fixed it.
Gosh, thank you! I was just about to post/ask about this. Using Autoptimize with its default settings plus GeneratePress' recommended settings was not aggregating generatepress/style.min.css and I couldn't figure out why...
Wasted a bit of time trying to sort it out and didn't think to review AO's default "exclude" field.
In fact, the settings screenshot on GeneratePress' help page even shows the wp-content/uploads directory as excluded. Tom and David, do you think it's worth addressing/fixing this there? It could help other folks too, and improve customer site optimization by not loading this additional file separately.
https://docs.generatepress.com/article/configuring-autoptimize/
Thanks!
Hi there,
Thanks for letting us know. Glad you got things sorted.
As for fixing this: It's not really a theme issue as it's on Autoptimize's side of things.
But yeah, I think this is worth atleast a mention for users generating external CSS. We'll see when we can add this in on the documentation. :D
Thanks Elvin! You're absolutely right that it's not a GP theme issue at all.
However, Autoptimize is extremely popular with over 1 million installs (you even use it on your own site) and GP's generated file will not be included in CSS aggregation with AO's default settings.
So, highlighting ("fixing") this on your AO recommended settings help page so that GP users can be sure to achieve maximal optimization of the theme is great. :)
Agreed. I think it may even be worth looking at moving the file outside the uploads folder.
For now, we'll mention this in our documentation to prevent further wasted time.
Thanks!