Hi there,
We’ve been using the Newspaper Theme for quite some time, and have a lot of posts already created on our current site: thecampingpage.com. The issue is that we just enabled a CDN via WPEngine, and it’s working for the logo and the base “src” images for the homepage image grid, as well as the featured images for each unique blog post, however, for all of the responsive “srcset” images, it’s using a /relative image path that doesn’t pick up the CDN path, just the standard /wp-content path.
We’ve tried the following:
1. Cleared all site-related caches.
2. Regenerated thumbnails on one of the posts (as a test).
3. Deleted the featured image and re-assigned it on one of the posts (as a test).
None of these solved the issue of the /relative path not picking up the CDN path for the associated image.
If you right click the featured image you can see an example of the image code being used for one of the blog posts: https://thecampingpage.com/explainer-how-to-choose-a-tent/
You can see that the initial image search is picking up the full CDN path, but all the “srcset” instances are using the /relative path.
Any ideas on how to get these images instances to use the CDN path?
Thanks for any and all assistance with this!
-
This topic was modified 7 years by
drewkelly. Reason: adding tag to display full html code
Hi,
Setting it up seems simple from what I can see – https://wpsmackdown.com/how-to-set-up-the-cdn-in-wp-engine/
– https://wpmayor.com/cdn-wpengine-maxcdn/
It does the job for the loaded image, the srcset images URL seems unusual. Maybe that is how it’s supposed to be, I can’t say because I did not use it.
You could try and contact them directly with this question however, they should know what to do if anything needs to be done – https://wpengine.com/support/
Thanks
Hi Simion,
Thanks for the response. Yes, setting up the CDN is very simple, and it’s working across the board with the exception of the srcset images instances, which, correct me if I’m wrong, is something that’s built into the Newspaper theme functionality. We even attempted to write a rule that would force these /relative URL instances to use the CDN path, but that doesn’t work.
Here’s the rule that was written:
#https?://(www\.)?(thecampingpage.com|socialmediamgr.wpengine.com|1y8omx3jegx244iu6v26zb15(.)wpengine.netdna-(ssl|cdn).com)/thecampingpage/wp-(content|includes)# => https://1y8omx3jegx244iu6v26zb15-wpengine.netdna-ssl.com/thecampingpage/wp-$5
Is there something in the theme functionality that’s forcing these /relative URL instances to reference the thecampingpage.com/thecampingpage/wp-content/ as opposed to the full CDN path?
Thanks again for your time and effort.
Hello,
The theme does indeed use secret to make the thumbnails needed for the different theme elements. https://www.screencast.com/t/8aquZeNHKM
Unfortunately i cannot say for sure why the srcset image sizes cannot be loaded from the cdn. We have not tested the wpengine cdn so we are not sure of the functionality used.
It seems this is not suported by wordpress by deafault as a quick google search led me here: https://github.com/2aces/wordpress-srcset-cdn
https://github.com/ResponsiveImagesCG/wp-tevko-responsive-images/issues/88
I hope this helps
Thank you!