Can you try adding the bunny root CDN to the Autoptimize CDN settings?
Thank you for the suggestion.
Yes, I tried both ways — with and without root CDN in the settings. Same
Rudolf
can you set the cdn-field in AO to https://hatsfromoz.b-cdn.net/ so I can take a look at your site in that state?
Done.
CDN field in AO set to https://hatsfromoz.b-cdn.net/
Thank you,
Rudolf
OK, can you clear W3TC’s cache?
Done.
I also tried to disable nginx server that is running as a proxy. Result is same. nginx is back on now.
Rudolf
weird … afraid I have no idea why this is not working Rudolf, I would suspect a conflict somewhere with another plugin or something. could have to do with the fact you have content instead of wp-content, although AO normally is OK with such changes (if done right) .. :-/
How does AO includes optimised scripts?
Or, rather, where in the code does it do so?
I have development experience, so will try to spread some debug in both AO and bunnyCDN plugins to hopefully figure it out
Rudolf
It hooks into template_redirect and catches all HTML in an output buffer, extracting all links to JS & CSS, combining them and re-inserting the optimized URL’s, returning the optimized HTML at the end.
When do you finish the output? Can’t find the place.
What I see is:
AO hooks into template_redirect
AO starts capturing the buffer
BunnyCDN hooks into template_redirect
AO callback “end_buffering” is called.
AO template_redirect runs at default ptiority of 2, BunnyCDN runs at 10. So should be OK, but seem that bunnyCDN tried to process HTMP before AO finished with it!
Dumping HTML received by bunnyCDN action confirms my suspicions — there is no autoptimised files in it.
Rudolf
At the end of the end_buffering function; https://github.com/futtta/autoptimize/blob/beta/classes/autoptimizeMain.php#L532
I would be kind of surprised this is related to output buffering & co, as AO is able to optimize the JS/ CSS and insert the links to the optimized files. the CDN-stuff is an inherent part of that logic as it’s called in the cache method of the respective optimizers, e.g. https://github.com/futtta/autoptimize/blob/cf716beec06f8b38b514aa2da74f302ea9b3e37b/classes/autoptimizeScripts.php#L572 ?
Hi,
Even putting debugging around your code, seems that replacement of URL with CDN happens AFTER data is output. Does not make sense!
I actually have another site with same combinations of plugins and they work quite happily together.
I now created a staging site for experiments. Disabled W3 cache completely and created new BunnyCDN account to play with.
I tried to disable all plugins (except Autoptimise and bunnyCDN) and switched to TwenyTwentyOne theme. Problem is still there.
Can I give you access? I am running out of ideas here
Thanks,
Rudolf
-
This reply was modified 5 years, 2 months ago by
rudolfl.
you can contact me at futtta-at-gmail-dot-com 🙂