[wordpress插件] C3 Cloudfront Cache ControllerC3 Cloudfront缓存控制器

wordpress 插件 文章 2020-03-15 03:00 580 0 全屏看文

AI助手支持GPT4.0

评分
80
描述

This is simple plugin that clear all cloudfront cache if you publish posts.

这是一个简单的插件,可以在发布帖子时清除所有Cloudfront缓存。

You can easy use CloudFront in front of WordPress.

您可以在WordPress之前轻松使用CloudFront。

Fixtures

固定装置

    • wp_is_mobile()

      wp_is_mobile()

      Check device viewer type by CloudFront header.

      通过CloudFront标头检查设备查看器类型。

      Now supports HTTP_CLOUDFRONT_IS_MOBILE_VIEWER and HTTP_CLOUDFRONT_IS_TABLET_VIEWER.

      现在支持 HTTP_CLOUDFRONT_IS_MOBILE_VIEWER HTTP_CLOUDFRONT_IS_TABLET_VIEWER

    • preview url

      预览网址

      In preview page, plugin add post_date query to avoid CloudFront cache.

      在预览页面中,插件添加 post_date 查询以避免CloudFront缓存。

      And set wordpress_loginuser_last_visit cookie for avoid CloudFront cache too.

      并设置 wordpress_loginuser_last_visit cookie以避免CloudFront缓存。

    The wordpress_loginuser_last_visit cookie will be removed if user sign out.

    如果用户退出,则将删除 wordpress_loginuser_last_visit cookie。

    Invalidation(Clear Cache) Page URL

    无效(清除缓存)页面网址

    This plugin send following page url to CloudFront Invalidation API.

    此插件将以下页面网址发送到CloudFront Invalidation API。

      • TOP page URL
      • TOP页面网址

      • Published Post Page URL
      • 发布的帖子页面URL

      • Category Archive Page URL
      • 类别存档页面URL

      AWS IAM Policy Example

      AWS IAM策略示例

      {    

        {    

      "Version": "2012-10-17",    

      “ Version”:“ 2012-10-17”,    

      "Statement": [        

      “声明”:[        

      {            

      {            

      "Action": [                

      “动作”:[                

      "cloudfront:GetDistribution",                

      “ cloudfront:GetDistribution”,                

      "cloudfront:ListInvalidations",                

      “ cloudfront:ListInvalidations”,                

      "cloudfront:GetStreamingDistribution",                

      “ cloudfront:GetStreamingDistribution”,                

      "cloudfront:GetDistributionConfig",                

      “ cloudfront:GetDistributionConfig”,                

      "cloudfront:GetInvalidation",                

      “ cloudfront:GetInvalidation”,                

      "cloudfront:CreateInvalidation"            

      “ cloudfront:CreateInvalidation”            

      ],            

      ],            

      "Effect": "Allow",            

      “效果”:“允许”,            

      "Resource": "*"        

      “资源”:“ *”        

      }    

      }    

      ]

      ]

      }

      }

      Adding your configuration through env vars

      通过环境变量添加配置

      The plugin can be configured by defining the following variables:

      可以通过定义以下变量来配置插件:

        • AWS_ACCESS_KEY_ID
        • AWS_ACCESS_KEY_ID

        • AWS_SECRET_ACCESS_KEY
        • AWS_SECRET_ACCESS_KEY

        • C3_DISTRIBUTION_ID
        • C3_DISTRIBUTION_ID

        You can put these variables like the code into the wp-config.php

        您可以将这些变量(如代码)放入wp-config.php

        php

          php

        define( 'AWS_ACCESS_KEY_ID', '' );

        define('AWS_ACCESS_KEY_ID','');

        define( 'AWS_SECRET_ACCESS_KEY', '' );

        define('AWS_SECRET_ACCESS_KEY','');

        define( 'C3_DISTRIBUTION_ID', '' );

        define('C3_DISTRIBUTION_ID','');

        Cookie

        饼干

        This plugin set a Cookie named wordpress_loginuser_last_visit to the user.

        此插件为用户设置了一个名为 wordpress_loginuser_last_visit 的Cookie。

        It prevents CDN caching when the user is previewing his posts or contents.

        当用户预览其帖子或内容时,它可以防止CDN缓存。

        Once logging out from Dashboard, plugin removes this cookie from user.

        从仪表板注销后,插件将从用户中删除此Cookie。

安装步骤

    1. Activate the plugin through the ‘Plugins’ menu in WordPress
    2. 通过WordPress中的“插件”菜单激活插件

    3. Create IAM user to attach valid IAM Policy for AWS CloudFront
    4. 创建IAM用户以为AWS CloudFront附加有效的IAM策略

    5. Configure the plugin settings from wp-admin
    6. 从wp-admin配置插件设置

下载地址
https://downloads.wordpress.org/plugin/c3-cloudfront-clear-cache.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] BreweryDB啤酒数据库
[wordpress插件] BizCalendar WebBizCalendar网站
[wordpress插件] Admin Hot Maintenance Mode管理员热维护模式
[wordpress插件] Connections Business Directory Offers连接业务目录优惠
[wordpress插件] DamnSexyBookmarks该死的性感书签
随便看看
教育科技公司申请微信支付被拒绝? 4798
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 6793
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 6128