tecnodesignc / core-module
EncoreCMS 3.0 的核心模块,每个安装都需要
3.0.0
2024-04-26 20:21 UTC
Requires
- php: ^8.2
- astrotomic/laravel-translatable: ^11.12
- composer/installers: ^2.1
- laravelcollective/html: ^6.3
- mcamara/laravel-localization: ^1.7
- nwidart/laravel-modules: ^10.0
- spatie/laravel-responsecache: ^7.4
- tecnodesignc/laravel-sidebar: ^2.7
- tecnodesignc/presenter: ^0.2.6
- tecnodesignc/stylist: ^2.1
- tightenco/ziggy: ^1.5
- yajra/laravel-datatables-oracle: ^10.3.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.14
- mockery/mockery: ^1.4.4
- orchestra/testbench: 3.8.*
- phpunit/phpunit: ^9.5
README
# 核心模块
激活缓存系统
修改
// config/app.php 'providers' => [ ... Modules\Core\Pagecache\ResponseCache\ResponseCacheServiceProvider::class, ];
此包还包含一个外观。
// config/app.php 'aliases' => [ ... 'ResponseCache' => Modules\Core\Pagecache\ResponseCache::class, ];
您可以使用以下命令发布配置文件
php artisan vendor:publish --provider="Modules\Core\Pagecache\ResponseCache\ResponseCacheServiceProvider"
可用的清除缓存命令
php artisan pagecache:clear
URL 重写
为了在缓存后直接服务静态文件,您需要正确配置您的 web 服务器以检查这些静态文件。
-
对于 nginx
更新您的
location
块的try_files
指令以包括对page-cache
目录的检查location / { try_files $uri $uri/ /page-cache/$uri.html /index.php?$query_string; }
-
对于 apache
打开
public/.htaccess
并在标签为Handle Front Controller
的块之前添加以下内容# Serve Cached Page If Available... RewriteCond %{REQUEST_URI} ^/?$ RewriteCond %{DOCUMENT_ROOT}/page-cache/pc__index__pc.html -f RewriteRule .? page-cache/pc__index__pc.html [L] RewriteCond %{DOCUMENT_ROOT}/page-cache%{REQUEST_URI}%{QUERY_STRING}.html -f RewriteRule . page-cache%{REQUEST_URI}.html [L]