Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling static content for a web site

I've been looking for techniques on how to manage static content for a web application. From what I've found, there is the pure OO approach, packaging all specific requirements in object metadata and generating a single CSS and JS file for each request path either in real time or compile time. There is also the technique of manually merging on each release.

My question is, what general techniques do you find useful when managing static data for a dynamic web application and have you found any particular software helpful (besides SVN/Git/etc.)?

like image 609
Scott Avatar asked Nov 14 '22 06:11

Scott


1 Answers

I use Phing (Ant for PHP) to run the CSS/JS through a compressor. From a user's browser, these compressed files are accessed via a resource retriever much like Facebook's rsrc.php. This script maps generated names to the physical names for browser cache control because the cache periods are rather long. These names are also changed when the CSS/JS is compressed to force users' browsers to grab fresh copies.

like image 151
Rob Olmos Avatar answered Dec 01 '22 17:12

Rob Olmos