[wp-hackers] Manipulation HTML to use a CDN

Marko Heijnen mailing at markoheijnen.nl
Tue Feb 5 19:21:12 UTC 2013


Today I was busy to make a really small plugin that handles my CDN for me and started to play with it so I can control it from another plugin when needed.

Now I'm curious what is better to do. For example when you want to offload JS, CSS and images to a CDN. Makes is more sense to use filter as 'script_loader_src', 'style_loader_src' and 'the_content' in favor of using ob_start with a callback. For me the first one seems cleaner then running a regex on the whole HTML.

If the first one is better does it make sense to be able to use a filter to modify the post object before it enters the cache instead of using the filter 'the_content'.
If I'm correct you can't do that at this moment.

Best regards,

Marko


More information about the wp-hackers mailing list