Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Stop browser to cache image ,css, js in cakePHP

    • 0
    • 0
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 536
    Comment on it

    core.php (inside /app/config/) has lot of features that help us improve our web application.

    Configure::write(Asset.timestamp, force);
    

    Setting the Asset.timestamp to force will add a time value after every css,js and image tag in your HTML. The benefit of this is that the browser will treat your css,js or image file as new.

    EX-

    link href=/css/common.css?1327389711
    

    so any changes made in any of them are quickly reflected.

    So your css tag will look like this link href=/css/common.css?1327389711

 1 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: