Download the PHP package metalmatze/laravel-html-cachebusting without Composer

On this page you can find all versions of the php package metalmatze/laravel-html-cachebusting. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-html-cachebusting

laravel-html-cachebusting

This repository is archived. If this is still a thing in 2017 and beyond, please contact me on Twitter. I might transfer this project to you!

This package extends Laravel's with simple cache busting, either by enabling it via a configuration and using the built-in and , or more explicitly by replacing calls to and in templates with and . Both methods bust browser cache by placing an md5 checksum into the filename of your asset.

For a cache buster providing more functionality, have a look at Laravel Cachebuster.

Build Status

Cache busting via configuration

After installation of this package calls to and will not automatically apply cache busting. To change this, publish the package configuration using Artisan.

php artisan config:publish metalmatze/laravel-html-cachebusting

This copies the file into . Setting to enables cache busting for all calls to both and .

Aside from that the configuration requires a white-list of extensions that should be busted, which by default is set to .js and .css files.

And the setting makes it possible to format the cache buster string a little bit; it is essentially an formatter, which expects exactly one .

Explicit cache busting

Note: explicit cache busting overrides the setting of the configuration file.

Busting cache for css files:

<link media="all" type="text/css" rel="stylesheet" href="http://example.com/css/main.ae3ab568f451e151a6d7a9b8615efaeb.css">

Busting cache for javascript files:

<script src="http://example.com/js/main.d3b8d8cde26b65f660ff8f8b0879ee94.js"></script>

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require metalmatze\laravel-html-cachebusting.

"require": {
    "laravel/framework": "4.0.*",
    "metalmatze/laravel-html-cachebusting": "dev-master"
},
"minimum-stability" : "dev"

Next, update Composer from the Terminal:

composer update

Once this operation completes, the final step is to add the service provider. Open app/config/app.php, and append a new item to the providers array.

'MetalMatze\Html\HtmlServiceProvider'

DO NOT replace it with laravel's default Illuminate\Html\HtmlServiceProvider since there would be no Form.

Adding the redirect to your .htaccess

RewriteRule ^(css|js)/(.+)\.([0-9a-f]{32})\.(js|css|png|jpg|gif)$ /(css|js)/$1.$3 [L]

Adding the redirect to nginx

rewrite "^(.+)\.([0-9a-f]{32})\.(js|css|png|jpg|gif)$" /$1.$3;

Contributing

This package adheres to PSR-2 standards, so before committing make sure your code is PSR-2 error free. To test compliance run

php vendor/bin/phpcs --standard=PSR2 src/ tests/```.

All versions of laravel-html-cachebusting with dependencies

PHP Build Version
Package Version
Requires illuminate/filesystem Version >=4.0
illuminate/html Version >=4.0
illuminate/routing Version >=4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package metalmatze/laravel-html-cachebusting contains the following files

Loading the files please wait ....