Download the PHP package ipunkt/laravel-route-cache without Composer

On this page you can find all versions of the php package ipunkt/laravel-route-cache. 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-route-cache

Route Cache for Laravel 4.x

Latest Stable Version Latest Unstable Version License Total Downloads

This package simplifies caching of static pages in your laravel project. It sends 304 status headers and (if available) static html without running the controller. The configuration ist easy and straight forward using a single route-filter.

Installation

Add to your composer.json following lines

"require": {
    "ipunkt/laravel-route-cache": "~1.0.0"
}

Run php artisan config:publish ipunkt/laravel-route-cache

Add 'Ipunkt\LaravelRouteCache\LaravelRouteCacheServiceProvider', to providers in app/config/app.php.

Configuration

Edit config.php in app/config/packages/ipunkt/laravel-route-cache to your needs.

How to use as Laravel Route-Filter

Add 'before' => 'cache.before' to every route you like to cache. The route has to be canonical!, because the filter caches just by extracting the url() from the Request. (maybe i change that to fullUrl())

To outdate a cache, just fire the Event entity.modified and attach the Request or URL of the modified ressource. You can force that on your browser by attaching the GET-Parameter set in your config as cachebuster (default is "renew-cache") to the URL.

If the infoheader config setting is not false the library adds a Header to the Response to show wether the content came from cache or the controller.

Other usages

The class Ipunkt\LaravelRouteCache\RouteCache works out of the box without the filter. You can use it in your controllers

// get RouteCache-Instance
$routecache = \App::make('routecache');
$routecache->setEntityFromRequest($request);
// or
$routecache->setEntityFromUrl($url);

// to remove the cache
$routecache->removeCache()

// to check if the client has a valid (same ETag) Cache
$routecache->checkClientHasValidCache()

// to save a Response to the Cache
$routecache->setCacheFromResponse(Response $response)

// to save string-content to the Cache
$routecache->setCacheFromContent($content)

// to get a saved Response from the Cache
$routecache->getResponseFromCache()

// to get a saved string from the Cache
$routecache->getContentFromCache()

// you can get the ETag for the entity (but you don't need it)
$routecache->getETag()

// you can even set a custom ETag if you like
$routecache->getETag($value)

Open TODOs

Feel free to fork and push changes


All versions of laravel-route-cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.*
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 ipunkt/laravel-route-cache contains the following files

Loading the files please wait ....