[wp-hackers] Using wp-content/uploads to store dynamically created js and CSS
nicola.peluchetti at gmail.com
Wed Jan 8 20:39:09 UTC 2014
means that we append a link /script to the website and then a PHP script
generates the relevant CSS/js.
We need to do this with CSS because we generate it from LESS files and give
because we use requirejs and we wanted to avoid using global variables in
We had a fallback system for storing CSS ( APC/Filesystem/DB ) while js was
In any case this has proven to be too slow and unreliable, so we'd like to
go back serving static css and js files and we thought we can use
wp-content/upload to store compilade .js and .css files.
I've read this article
http://ottopress.com/2011/tutorial-using-the-wp_filesystem/ where Otto says
to inline, but if i inline my js / css is not cached by the browser
right?And we are talking about 500kb so it's not trivial.
What do you think of the approach and have you got anything better to
*Nicola Peluchetti - Senior PHP Developer @ Timely*
Twitter: @nik_peluchetti <https://twitter.com/#!/nik_peluchetti>
Facebook: nicola.peluchetti <https://www.facebook.com/nicola.peluchetti>
Mobile: +39 339 7507235
More information about the wp-hackers