Articles tagged with: cache
Uncategorized »
I am going to post very handy tip for javascript and css files caching. Browsers automatically cache the css and JS files and when you make change to CSS and JS some times change does not appears.
To prevent this use following
<?php
echo ‘<link rel=”stylesheet” type=”text/css” href=”style.css?’ . filemtime(’style.css’) . ‘” />’;
?>
And For JS
<?php
echo ‘<script type=”application/javascript”=”main.js?’ . filemtime(’main.js’) . ‘” />’;
?>
The PHP function filemtime returns last modified date of file, so every time you make change in css / JS files the filemtime will return different value and CSS / JS Url …
Uncategorized »
When you move cakephp site from 1 server to anothr, you sometimes see blank page even debuging is on. To avoid this alway remember to clear cache. Remove all files from /app/tmp/cache/model and /app/tmp/cache/persistent.
