ether/nginx-cache 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ether/nginx-cache

Composer 安装命令:

composer require ether/nginx-cache

包简介

Smart static caching with Nginx

README 文档

README

Nginx Cache

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固