[wp-hackers] Using wp-content/uploads to store dynamically created js and CSS

Justas Butkus jbutkus at time.ly
Thu Jan 9 08:33:38 UTC 2014


Hello Brian.

If I see it right, and please correct me if I miss something, your 
proposed solution gives best performance, when site uses a CDN, or at 
least has a caching reverse HTTP proxy in front of WordPress.

In general case - sites don't have anything like this. And then every 
new user (some of whom might have troubles with cache, but let's say 
that's just some 15% increase in traffic) requires your site to build 
that file. If you have a pre-generated JavaScript, served as an actual 
static file, the WordPress isn't even touched, but with your approach 
every request by each new user causes new generation, which might impose 
significant increase in resources utilization.

Maybe you have some considerations how to counter-act that?
I mean except recommending each and every user to have a 
CDN/caching-proxy, which would be good, just as good as asking everyone 
to use PHP 5.5, which was discussed here few weeks ago. :-)


-- 
Regards,
Justas B.

2014.01.09 00:35, Brian Fegter rašė:
> Nicola,
>
> Instead of generating an actual static file, why not use a rewrite? You
> won't have to deal with the file system at all and any quirks that come
> with your setup.
>
> Heres a gist with the setup I use for this type of thing. This allows you
> to use object caching and your CDN sees this as a static file as well.
> https://gist.github.com/inspectorfegter/8325711
>
> Let me know if you have any question on this approach. Just another way to
> skin a cat.
>
> Thanks!
> Brian



More information about the wp-hackers mailing list