ceesvanegmond / laravel4-cachebust

Cachebusting package for Laravel 4.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cachebusting package for Laravel 4

This package allows you to use cachebusting helpers for your images. This feature adds an timestamp (modified date) to the file. So the user always will have the latest version of the image. In your .blade files, use the cachebust() method at an imagepath.

Do not forget to add this in config/app.php under providers:

  	'CeesVanEgmond\Minify\MinifyServiceProvider',

Dont forget to add this in your public/.htaccess to make it work:

  
    RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
 
 

You may now use it like this:

  img src="{{ cachebust('images/image.png') }}">
 

Or with Blade templating:

  	{{ HTML::image( cachebust('images/image.png') ) }}
 

Is you have any questions, bugs of comments, mention it in this repository.

About

Cachebusting package for Laravel 4.


Languages

Language:PHP 100.0%