mutation/filecache
最新稳定版本:4.0.0
Composer 安装命令:
composer require mutation/filecache
包简介
Cache templates to html files
README 文档
README
The html file cache is created automatically when you visit a page and then served when the page is visited after. The cache automatically is cleared when an element is saved, modified or deleted.
Installation
Install the plugin via the Plugin Store or by command line:
composer require mutation/filecache
php craft install/plugin filecache
Configuration
Add a file named filecache.php to the config folder:
<?php
return [
'*' => [
'excludedEntrySections' => [],
'excludedEntryTypes' => [],
'excludedSites' => [],
'cacheFolderPath' => 'filecache'
]
];
Exclude entries from cache by section excludedEntrySections, type excludedEntryTypes or site excludedSites by adding the section/type handles to their respective arrays.
How to use
You can visit this url to clear the cache manually: /admin/utilities/clear-caches.
You can also use these 2 console commands (@web alias must be set to an absolute url):
php craft clear-caches/file-caches
Dynamic content
Use this template code to inject the csrf token in html:
{{ craft.filecache.injectCsrfInput() }}
Use this template code to inject the csrf token as global Javascript variables:
{{ craft.filecache.injectJsCsrfToken() }}
统计信息
- 总下载量: 3.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-02