Download the PHP package aculix99/laravel-quick-static without Composer
On this page you can find all versions of the php package aculix99/laravel-quick-static. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-quick-static
- Introduction
- Installation
- Install with Composer
- .gitingore
- URL Rewriting
- Snippet
- Full file as reference
- Configuration
- Publish config file
- Cache config file
- Composer
- Customizations
- Usage
- Using the middleware
- Clearing the cache
- Optimization
- License
Introduction
This package allows you to serve static html, json and xml files without booting laravel for best performance! It's inspired by page-cache.
Installation
Install with Composer
.gitingore
- Add the cache folder name (default =
_quick-static) to your.gitingoreto avoid cached files in your vcsURL Rewriting
Snippet
Add these lines to the
public/index.phpof your laravel application right after the use statements:
Full file as reference
Your full index.php will then look like this:
Configuration
Publish config file
Cache config file
- The config file needs to be cached so that the loader.php can read it without booting laravel.
- Run the following command to generate
bootstrap/cache/quick-static.php
Composer
- Add these two commands to your
post-autoload-dump-script
Customizations
Feel free to use and adjust the loader within your index.php the way you like it. Since it's PHP rewriting, you can do your very own, performant PHP MAGIC. Also you can ignore cached files if query parameters are present.
Usage
Using the middleware
Just add the middleware to the corresponding routes like this:
Clearing the cache
Optimization
- The quick-static compiled config cache file will be automatically created and deleted when
php artisan optimizeandphp artisan optimize:cleargets utilized. - Furthermore the config file will be cached when the composer script
post-autoload-dumpruns, so after everycomposer dump-autoloadcomposer installcomposer update
- Also you can manually create and delete the compiled config file:
php artisan quick-static:cache-configphp artisan quick-static:clear-cached-config
License
This package is open-sourced software licensed under the MIT license.
All versions of laravel-quick-static with dependencies
symfony/http-foundation Version ^7.0
illuminate/console Version ^12.0
voku/html-min Version ^4.5