2017 © Pedro Peláez
 

library laravel-static-html-cache

store/cache generated responses as a static file

image

mscharl/laravel-static-html-cache

store/cache generated responses as a static file

  • Thursday, August 31, 2017
  • by mscharl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,262 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

laravel-static-html-cache

store/cache generated responses as a static file, (*1)

Setup

Add the service provider to the config/app.php provider array, (*2)

MScharl\LaravelStaticHtmlCache\Provider\LaravelStaticHtmlCacheProvider::class,

Then add the middleware to the end of your Http/Kernel.php middleware array. ```php protected $middleware = [ \MScharl\LaravelStaticHtmlCache\Http\Middleware\LaravelStaticHtmlCacheMiddleware::class, ];, (*3)


Add the following snippet into your `.htaccess` ```apacheconfig # Rewrite to html cache if it exists and the request is off a static page # (no url query params and only get requests) RewriteCond %{REQUEST_METHOD} GET RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{DOCUMENT_ROOT}/cache/html%{REQUEST_URI}/index.html -f RewriteRule ^(.*)$ /cache/html%{REQUEST_URI}/index.html [L]

Clear the files

To clear all the files manually you can use an artisan task., (*4)

php artisan static-html-cache:clear

The Versions

31/08 2017

dev-master

9999999-dev

store/cache generated responses as a static file

  Sources   Download

MIT

The Requires

 

by Michael Scharl

31/08 2017

v1.1

1.1.0.0

store/cache generated responses as a static file

  Sources   Download

MIT

The Requires

 

by Michael Scharl

11/04 2017

v1.0

1.0.0.0

store/cache generated responses as a static file

  Sources   Download

MIT

The Requires

 

by Michael Scharl