CDN, filters
-
I’m using wpengine to host my WP site and using their CDN. I asked them for the CDN Base URL but every time I enter this, it breaks the website.
Can someone help assist with this?
Also, where would I add this filter:
add_filter(‘autoptimize_filter_noptimize’,’pagebuilder_noptimize’,10,0);
function pagebuilder_noptimize() {
if (is_user_logged_in()) {
return true;
} else {
return false;
}
}In the functions.php file?
-
cfr. the CDN-url; what’s your site’s URL and what CDN url did you enter exactly?
regarding the code; you can use the code snippets plugin to add & manage filters like those or -if you insist- indeed in your (child) theme’s functions.php (it would get overwritten with each theme update though).
frank
Hi Frank,
Website is: starmarkhealth.com
CDN URL: https://ipuz541vy6z2rsd1v1j06cpv-wpengine.netdna-ssl.com
Cool, didn’t know about that plugin. Yes, have a child’s theme so just wanted to double confirm.
-
This reply was modified 9 years, 2 months ago by
recesspro.
https://ipuz541vy6z2rsd1v1j06cpv-wpengine.netdna-ssl.com -> “Firefox canβt find the server at ipuz541vy6z2rsd1v1j06cpv.wpengine.netdna-ssl.com”.
you’d better double-check the CDN url with WP engine π
Hi Frank,
CDN was wrong, they gave me this one too:
ipuz541vy6z2rsd1v1j06cpv.wpengine.netdna-cdn.com
This seems to work but it still breaks the website.
well, autoptimized CSS seems to be loaded from the CDN and all seems ok;
<link type="text/css" media="all" href="https://ipuz541vy6z2rsd1v1j06cpv-wpengine.netdna-ssl.com/wp-content/cache/autoptimize/css/autoptimize_732b60711bb9a024f89348885cb57fbf.css" rel="stylesheet" />Hi Frank,
I added the snippets plugin for the visual composer issue. I figured out the base CDN url was https://ipuz541vy6z2rsd1v1j06cpv-wpengine.netdna-ssl.com not https://ipuz541vy6z2rsd1v1j06cpv.wpengine.netdna-cdn.com.
I have the optimized options selected for html, JS and css but the website is slower now.
https://www.screencast.com/t/3SEJlFGAziMV
https://www.screencast.com/t/Hduf1DG6ZI see a bunch of warnings in the console. Can you take a look and let me know what I should change?
I also notice my product page images are breaking because of a jquery error which I thought was disabled. https://www.screencast.com/t/lA1zodB9N
Thanks!
regarding the warnings in the console; 1 see 3 (the jquery migrate notice, a warning about an image on a non-https URL and a warning about an unsecure operation in JS) but I also see the same when AO is disabled (just add
?ao_noptimize=1to the URL) so those seem not an AO-issue?for the other questions (speed & the product page); I’ll look into those tomorrow π
How/where do I add this code (?ao_noptimize=1) to the URL?
Thank you.
well, example for your homepage;
starmarkhealth.com/?ao_noptimize=1πgot it, still see this though: https://www.screencast.com/t/UT7VC0sHd
my point exactly; as you still get errors (warnings) with AO disabled, this is in fact not an AO issue π
That’s fine, but the other issues are when AO is enabled. Curious your responses about the speed and product page issues.
Thanks.
ok, back π
on the speed question; I ran multiple tests with and without AO (that good old
?ao_noptimize=1trick) on the sublime https://webpagetest.org/ site. the results for “load time” are somewhat unclear, sometimes the pages with AO are faster, sometimes speed is (almost) the same, sometimes AO is (a bit) slower (you’re on HTTP/2, which explains why your site is not suffering that much from not optimizing).test results with AO:
https://www.webpagetest.org/result/170316_8B_1GYK/
https://www.webpagetest.org/result/170316_68_1HEY/
https://www.webpagetest.org/result/170316_D1_1H2M/
https://www.webpagetest.org/result/170316_SF_1H10/test results without AO:
https://www.webpagetest.org/result/170316_Q5_1H82/
https://www.webpagetest.org/result/170316_AN_1GZQ/
https://www.webpagetest.org/result/170316_Q5_1H82/BUT … there are actually multiple “times” to take into account:
* time to first byte
* time to start render
* time to load (= “load time”)
* time to visually complete
* time to fully loaded
* time to interactiveand the tests with AO are consistently faster on most of those actually.
this is confirmed by one other important webpagetest metric, the “speed index” (more info here) and the tests with AO yield a speed-index of 6000+ vs the ones without AO that are 7000+
so based on this data, I can only conclude your site is faster with Autoptimize …
now that problem on your product-pages; I’ll have a look, but you’ll have to re-enable AO :-p
-
This reply was modified 9 years, 2 months ago by
The topic ‘CDN, filters’ is closed to new replies.