slav123 / CodeIgniter-minify

CodeIgniter minify library CSS and JavaScript compression on the fly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strip cache busting from filenames

screamingjungle opened this issue · comments

commented

Inside _scan_files() you can filter out any cachebusting on the files.

for example, some would use /style.css?version=1
this creates an error so you'll want to discard anything after ?

something like:
$filename = $directory . '/' . preg_replace('#\?.*#', '', $file);

You find this again inside _concat_files()
$file_name = $directory . '/' . preg_replace('#\?.*#', '', $file_name);

You should strip all the filenames entered into Minify.

Adding any parameters to file names shouldn't take place. This library has an option to do this automatically.

So... in this case, raising an error is a good thing. I like to think that developers are smart people :)