ceesvanegmond/cachebust

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (dev-master) of this package.

A small Laravel4 library to add cachebusting to images. Use the cachebust() helper to get the cachebusted file + timestamp.

dev-master 2013-12-03 16:19 UTC

This package is auto-updated.

Last update: 2022-02-01 12:25:21 UTC


README

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.