WordPress.org

Plugin Directory

Changeset 1739459


Ignore:
Timestamp:
10/02/17 10:13:31 (3 months ago)
Author:
hideokamoto
Message:

v4.3.1

Location:
c3-cloudfront-clear-cache/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c3-cloudfront-clear-cache/trunk/c3-cloudfront-clear-cache.php

    r1525076 r1739459  
    22/* 
    33 * Plugin Name: C3 Cloudfront Cache Controller 
    4  * Version: 4.3.0 
     4 * Version: 4.3.1 
    55 * Plugin URI:https://github.com/megumiteam/C3-Cloudfront-Clear-Cache 
    66 * Description:This is simple plugin that clear all cloudfront cache if you publish posts. 
  • c3-cloudfront-clear-cache/trunk/module/model/invalidation.php

    r1525076 r1739459  
    5252            return; 
    5353        } 
     54        $interval_minutes = apply_filters( 'c3_invalidation_cron_interval', 1 ); 
    5455        $query = $this->_merge_transient_invalidation_query( $query ); 
    55         set_transient( self::C3_CRON_INDALITATION_TARGET , $query , 5 * 60 ); 
    56         $time = time() + MINUTE_IN_SECONDS * 5; 
     56        set_transient( self::C3_CRON_INDALITATION_TARGET , $query , $interval_minutes * MINUTE_IN_SECONDS * 1.5 ); 
     57        $time = time() + MINUTE_IN_SECONDS * $interval_minutes; 
    5758        wp_schedule_single_event( $time, 'c3_cron_invalidation'); 
    5859    } 
     
    6364     * @since 4.3.0 
    6465     * @access public 
    65      * @param array $query 
    6666     **/ 
    6767    public function cron_invalidation() { 
     
    9393            $query['Paths']['Items'] = array_merge( array_unique( $query['Paths']['Items'] ) ); 
    9494            $item_count = count( $query['Paths']['Items'] ); 
    95             if ( 10 < $item_count ) { 
     95            if ( apply_filters( 'c3_invalidation_item_limits', 100) < $item_count ) { 
    9696                $query['Paths'] = array( 
    9797                    'Quantity' => 1, 
     
    166166    private function _do_invalidation( $cf_client, $query ) { 
    167167        try { 
    168             set_transient( self::C3_INVALIDATION_KEY , true , 5 * 60 ); 
     168            set_transient( self::C3_INVALIDATION_KEY , true , apply_filters( 'c3_invalidation_interval', 1 ) * 60 ); 
    169169            $result = $cf_client->createInvalidation( $query ); 
    170170            return true; 
  • c3-cloudfront-clear-cache/trunk/readme.txt

    r1525076 r1739459  
    44Tags: AWS,CDN,CloudFront 
    55Requires at least: 4.3.1 
    6 Tested up to: 4.6.1 
    7 Stable tag: 4.3.0 
     6Tested up to: 4.8.2 
     7Stable tag: 4.3.1 
    88License: GPLv3 or later 
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    3434 
    3535== Changelog == 
     36 
     37= 4.3.1 = 
     38* Fix cron interval 
     39* add filters `'c3_invalidation_interval`, `c3_invalidation_cron_interval`, `c3_invalidation_item_limits`. 
     40* update default invalidation interval & items. 
    3641 
    3742= 4.3.0 = 
     
    116121== Upgrade Notice == 
    117122 
    118 = 4.3.0 = 
    119 * Schedule cron event if you published many post at the same time 
     123= 4.3.1 = 
     124* Fix cron interval 
     125* add filters `'c3_invalidation_interval`, `c3_invalidation_cron_interval`, `c3_invalidation_item_limits`. 
     126* update default invalidation interval & items. 
Note: See TracChangeset for help on using the changeset viewer.