ether/nginx-cache
Composer 安装命令:
composer require ether/nginx-cache
包简介
Smart static caching with Nginx
README 文档
README
Nginx Cache
Harness the power of Nginx to statically cache your Craft site.
TTFB below 5ms!
Usage
Site Config
Update your sites Nginx conf file to include the three includes below (they are located in your site's storage directory):
include /path/to/site/storage/nginx/cache.conf; server { # ... include /path/to/site/storage/nginx/cache-server.conf; # ... location ~ \.php$ { # ... include /path/to/site/storage/nginx/cache-location.conf; # ... } }
Reload Command
The reload command will be executed using exec after the config is saved. If
you find that the command isn't working (Nginx isn't reloading after save) it
is likely due to PHP not having permission to run the command. You can give PHP
permission by adding the command to your server's sudoers file. To edit your
sudoers file run $ sudo visudo on your server, then add the following:
www-data ALL=(ALL:ALL) NOPASSWD:nginx -s reload
Substitute nginx -s reload with whatever your command is.
If you don't have a sudoers file you will need to manually reload Nginx after
each save of the plugin config.
Docker
If you are using Docker ensure that your chosen cache directory and Craft's storage directory (or at least the Nginx directory in storage) are available to both your PHP and Nginx containers.
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-08
