Download the PHP package label-li/laravel-page-cache without Composer

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

Laravel Page Cache

Latest Stable Version License

This package allows you to easily cache responses as static files on disk for lightning fast page loads.

This package can cache static PHP page on local disk to provide a fast loading of pages

Introduction

It would be a heavy loading if lots of visitors plus the page loading lots of content from database with lots of logic Page cache can reduce the loading.

installation

1) Install package with composer:

2) Publish the config to config/pagecache.config

Middleware

If you want to cache all route in middleware web, i.e., all http traffics: 1) Open app/Http/Kernel.php 2) Copy \LabelLi\LaravelPageCache\Middleware\CacheResponse::class, as a new line to the web middleware group:

If you want to cache specific route page-cache: 1) Open app/Http/Kernel.php 2) Copy 'page-cache' => \LabelLi\LaravelPageCache\Middleware\CacheResponse::class, as a new line to the $routeMiddleware:

Config

Change the value in config/pagecache.php to what you want:

Usage

Using the middleware

If you choose to cache specific route, e.g. page-cache, use the page-cache middleware as follow:

/page will be cached to a file under the storage/**$CachePath** directory.

Clearing the cache

The cache will be cleared with the CacheTime set in config/pagecache.php. It is default 3600s.

If you want to clear it manually, please run the following command

You may optionally pass a URL slug to the command, to only delete the cache for a specific page:

To clear everything under a given path, use the --recursive flag:

Remark

If the Console function is not working, most likely to be the problem of permission for the cache folder. Please check with ls -la to check for the permission.

Credit

Thanks to Joseph Silber. The idea to run cache function directly at middleware is from his package. His package is very great but I have different usage. So I write another page cache package to archive my usage.


All versions of laravel-page-cache with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
laravel/framework Version ^v8.0.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 label-li/laravel-page-cache contains the following files

Loading the files please wait ....