[wp-hackers] Manipulation HTML to use a CDN

Ben May bmay at alyte.com.au
Wed Feb 6 05:39:05 UTC 2013


Hi Marko

I find the problem with trying to filter individual elements is that you
can miss some, or some items that may be hard coded in the template etc.

At least if you filter the output buffer, you can't miss anything



-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Marko
Heijnen
Sent: Wednesday, 6 February 2013 6:16 AM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Manipulation HTML to use a CDN

Hey Simon,

I saw that one and that is part of the reason I asked since Mark is using
ob_start() for it.

Marko

Op 5 feb. 2013, om 21:14 heeft Simon Dunton - WP Sites
<simon at wpsites.co.uk> het volgende geschreven:

> Hi,
>
> If it's a pull CDN your working with then take a look at Mark Jaquiths
> CDN drop-in that does that job pretty well
> https://github.com/markjaquith/WP-Stack/blob/master/WordPress-Dropins/
> wp-stack-cdn.php
>
> Simon
>
> On 5 Feb 2013, at 19:21, Marko Heijnen wrote:
>
>> 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
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list