subs_filter cdn issue with posts text

Using your recommended way of loading images from a cdn here https://rtcamp.com/blog/easyengine-3-3-full-page-redis-cache/ works perfectly. Except I’ve noticed one issue, the filter actually rewrites the code in my blog posts themselves when I edit the post. It’s only a problem if I ever stopped using the cdn, then the links in all my posts will be hard coded to the cdn. Is there a way to prevent this?

1 Like

If this is helpful to anyone else, I stopped using the recommended subs_filter and switched to this https://github.com/wmark/CDN-Linker. So far it seems to be working perfectly, it seems like things are still cached properly by redis and I can’t see any type of speed issues with the plugin. Unless I find out an issue this seems to be a better way to rewrite links to a cdn without resorting to a bloated caching plugin.

1 Like

I’m late to the party but was having a similar problem… I just discovered a solution that works great for me. I added these lines to a conf file in my site/conf/nginx/ directory.

set $bypass "0";
if ( $request_uri ~* "/wp-admin" ) {
    set $bypass "1";
}
subs_filter_bypass $bypass;

That works great, I hope they update the original post with this info it helps a lot.