Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minify, how to clear cache?

I'm using Zend Framework with minify,

I updated Jquery and JqueryUI javascripts,

I cleared all browser cache, restarted the webserver,

but I still get the old files, how can I make it see the new files ?

I checked the file create/modify date, it's today(since I unziped them), I'm on Windows, don't know if that changes anything

I'm using Firebug and I see the old jquery 1.5.1 instead of the new 1.6.1

like image 894
max4ever Avatar asked May 19 '11 10:05

max4ever


2 Answers

I use the same setup, and in minify config, you can setup a base directory for your cache files. If you don't specify it, it defaults to - as I remember - the webservers' tmp folder. If you do not see your changes, it usually means, these files are still on the system, so a simple Ctrl+F5 won't clear out the server side cache files.

Minify config example:
$min_cachePath = '/var/www/example.com/cache/minify';

Update for you:

Example using WAMP server on windows:

example.com is at: d:/www/example.com

minify folder: d:/www/example.com/htdocs/static/utils/min (note: you can also have min under example.com/htdocs/min, it is just how I prefer it)

in min/config.php I have this:

$min_allowDebugFlag = false;
$min_errorLogger = false;
$min_enableBuilder = false;

$min_cachePath = 'd:/www/example.com/cache/minify';

$min_documentRoot = '';
$min_cacheFileLocking = true;
$min_serveOptions['bubbleCssImports'] = false;
$min_serveOptions['maxAge'] = 31556926;
$min_serveOptions['minApp']['groupsOnly'] = false;
$min_serveOptions['minApp']['maxFiles'] = 10;

So basically I set it relative to the site root, not to the server's own tmp directory.

like image 158
Gergely Havlicsek Avatar answered Sep 18 '22 15:09

Gergely Havlicsek


If you want to ensure that all the minified files are recreated with your updated JavaScript or CSS, remove all the minified files from the temporary folder(s).

On a Linux system, do this:

sudo rm /tmp/minify_*

On a Windows system, do this:

DEL %TEMP%\minify_* %SystemRoot%\Temp\minify_*
like image 29
Christopher Avatar answered Sep 18 '22 15:09

Christopher