承接 aculix99/laravel-quick-static 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aculix99/laravel-quick-static

Composer 安装命令:

composer require aculix99/laravel-quick-static

包简介

Serve static html, json and xml files without booting laravel for best performance

README 文档

README


Latest Version on Packagist Total Downloads

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

composer require aculix99/laravel-quick-static

.gitingore

  • Add the cache folder name (default = _quick-static) to your .gitingore to avoid cached files in your vcs

URL Rewriting

Snippet

Add these lines to the public/index.php of your laravel application right after the use statements:

define('QUICK_STATIC_ROOT', __DIR__);
require __DIR__ . '/../vendor/aculix99/laravel-quick-static/loader.php';

Full file as reference

Your full index.php will then look like this:

<?php

use Illuminate\Foundation\Application;
use Illuminate\Http\Request;

define('QUICK_STATIC_ROOT', __DIR__);
require __DIR__ . '/../vendor/aculix99/laravel-quick-static/loader.php';

define('LARAVEL_START', microtime(true));

// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
    require $maintenance;
}

// Register the Composer autoloader...
require __DIR__.'/../vendor/autoload.php';

// Bootstrap Laravel and handle the request...
/** @var Application $app */
$app = require_once __DIR__.'/../bootstrap/app.php';

$app->handleRequest(Request::capture());

Configuration

Publish config file

php artisan vendor:publish --tag=quick-static

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
php artisan quick-static:cache-config

Composer

  • Add these two commands to your post-autoload-dump-script
"post-autoload-dump": [
    // "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
    // "@php artisan package:discover --ansi",
    "@php artisan vendor:publish --tag=quick-static",
    "@php artisan quick-static:cache-config"
],

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:

...
Route::middleware(\Aculix99\LaravelQuickStatic\Middleware\StoreStatic::class)->group(function() {
    Route::get('/path', fn() => view('test'));
    Route::get('/json', fn() => response()->json('test'));
});
...

Clearing the cache

php artisan quick-static:clear

Optimization

  • The quick-static compiled config cache file will be automatically created and deleted when php artisan optimize and php artisan optimize:clear gets utilized.
  • Furthermore the config file will be cached when the composer script post-autoload-dump runs, so after every
    • composer dump-autoload
    • composer install
    • composer update
  • Also you can manually create and delete the compiled config file:
    • php artisan quick-static:cache-config
    • php artisan quick-static:clear-cached-config

License

This package is open-sourced software licensed under the MIT license.

aculix99/laravel-quick-static 适用场景与选型建议

aculix99/laravel-quick-static 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 10 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「json」 「xml」 「html」 「static」 「caching」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 aculix99/laravel-quick-static 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 aculix99/laravel-quick-static 我们能提供哪些服务?
定制开发 / 二次开发

基于 aculix99/laravel-quick-static 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-09