Open marcelstoer opened 7 years ago
Some notes on this issue:
ob_start()
.init
action handlers run at the default priority, except
PgCache.php W3_Plugin_PgCache::run
, which sets up an init handler at priority 99999 to implement full-page cachingExtension_FragmentCache_Plugin::run
which sets up an init handler at priority 9999999 to implement a fragment cacheThanks for the analysis. I don't know enough about the WordPress innards to understand what the consequences of your notes are. It sounds like it won't be possible to "fix" this from your end, though. How about adding a plugin config for a static hostname? If set you'd send absolute URLs rather than relative URLs.
I'm noticing this as well, when testing my site using https. CDN settings are ignored for the link preload items placed in the response header.
So my css file and 2 js files are all being loaded twice on my home page. Once from the CDN, and once from my origin server.
Turning off HTTP/2 push on both css and js Minify config removes the Link preload items from the response. But underlying issue should probably be fixed.
I use W3 Total Cache (to e.g. set the CDN) and your plugin. However, the two don't play nice.
Chrome warns e.g.
Your plugin preloads https://frightanic.com/blog/wp-includes/js/wp-emoji-release.min.js?ver=4.7.3 but the asset is effectively served from the CDN at https://dziadalnfpolx.cloudfront.net/blog/wp-includes/js/wp-emoji-release.min.js?ver=4.7.3.
That is because the configured CDN hostname is
dziadalnfpolx.cloudfront.net
whereas your plugin uses host-relative URLs thus preloading fromfrightanic.com
instead. This effectively renders the effect of your plugin moot.It wouldn't even help if I set a CNAME for the CDN (such as e.g.
cdn.frightanic.com
) because it'd still be different from the original hostname.