stefan-jonker / php-concat-js

Proof of concept for concatenating JavaScript-files with PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Concat files with PHP and cache busting

Proof of concept to concatenate files with PHP and add cache busting.

This is useful, because you can minify the files beforehand and the build-script is written in plain PHP (except for the additional bash-script).

PHP will preserve the order of the files (see console) to avoid race conditions.

These are the parts to make it work:

  • .htaccess file to remove the date string ("file.js.20150806.php")
  • Bash-script to rewrite the files from the /src/ to the /dist/ with the new date string
  • PHP-file wich will request our file with an added date string

Note (to self): Date should be replaced with something more sensible, like an MD5-hash (disk performance?) or something.

About

Proof of concept for concatenating JavaScript-files with PHP

License:GNU General Public License v3.0


Languages

Language:PHP 85.6%Language:Shell 10.0%Language:JavaScript 4.5%