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

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

Cache contents of entire route in Laravel

This is a Laravel 5.0+/PHP 5.4+ package that caches the response to an entire "get" request in the cache so subsequent requests to the same url are speeded up substantially.

Installation

Every effort has been made to insure that the package is extremely easy to install and use. After you "require" the package, you are ready to use it! There is no need for setting up service providers, facades, config files etc.

Usage

Edit your http kernel.php file to include the package like so:

Now, use the middleware to cache the HTML output of an entire page either from the controller or from your route like so:

  1. In your controller:

  2. In your route:

    Using Laravel 5.0

    Using Laravel 5.1+

    You can continue using Laravel 5.0 style.. or use chaining:

    You may also use route groups. Please look up Laravel documentation on Middleware to learn more https://laravel.com/docs/5.2/middleware

    Configuration Options

    Two configuration options (set via env parameters) are used by the package

  3. Cache TTL (Time-To-Live):

    CACHE_TTL=30

    This parameter specifies a cache ttl value of 30 minutes

    Note that you can always use php artisan cache:flush to clear your application cache

  4. Enable Cache (defaults to true):

    CACHE_ENABLE=false

    This parameter can be used to turn off caching

Thoughts

Be VERY cautions when using a whole page cache such as this. Remember contents of the cache are visible to ALL your users.

  1. For, "mostly static" content, go for it!
  2. For, "mostly dynamic" content or heavily user-customized content, AVOID this strategy. User specific information is gathered server side. So, you essentially WANT to hit the server.

Good rule of thumb: If two different users see different pages on hitting the same URL, DO NOT cache the output using this strategy. An alternative may be to cache database queries.


All versions of laravel-cache-route with dependencies

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

Loading the files please wait ....