mirror of
https://github.com/silverstripe/silverstripe-versionfeed
synced 2024-10-22 11:05:31 +02:00
Merge pull request #23 from tractorcow/pulls/tests
Tests for 3.2 and php 5.6
This commit is contained in:
commit
5b6dae480f
@ -13,12 +13,12 @@ env:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: 5.3
|
|
||||||
env: DB=PGSQL CORE_RELEASE=3.1
|
|
||||||
- php: 5.4
|
- php: 5.4
|
||||||
env: DB=MYSQL CORE_RELEASE=3.1
|
env: DB=PGSQL CORE_RELEASE=3.1
|
||||||
- php: 5.5
|
- php: 5.5
|
||||||
env: DB=MYSQL CORE_RELEASE=3.1
|
env: DB=MYSQL CORE_RELEASE=3
|
||||||
|
- php: 5.6
|
||||||
|
env: DB=MYSQL CORE_RELEASE=3.2
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- phpenv rehash
|
- phpenv rehash
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// Set the cache lifetime to 5 mins.
|
|
||||||
SS_Cache::set_cache_lifetime('VersionFeed_Controller', 5*60);
|
|
10
changelog.md
Normal file
10
changelog.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## [1.2.0]
|
||||||
|
|
||||||
|
* Changelog added.
|
||||||
|
* Add `ContentFilter.cache_lifetime` config to set the cache lifetime.
|
@ -14,6 +14,14 @@ abstract class ContentFilter {
|
|||||||
* @var ContentFilter
|
* @var ContentFilter
|
||||||
*/
|
*/
|
||||||
protected $nestedContentFilter;
|
protected $nestedContentFilter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cache lifetime
|
||||||
|
*
|
||||||
|
* @config
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private static $cache_lifetime = 300;
|
||||||
|
|
||||||
public function __construct($nestedContentFilter = null) {
|
public function __construct($nestedContentFilter = null) {
|
||||||
$this->nestedContentFilter = $nestedContentFilter;
|
$this->nestedContentFilter = $nestedContentFilter;
|
||||||
@ -27,6 +35,10 @@ abstract class ContentFilter {
|
|||||||
protected function getCache() {
|
protected function getCache() {
|
||||||
$cache = \SS_Cache::factory('VersionFeed_Controller');
|
$cache = \SS_Cache::factory('VersionFeed_Controller');
|
||||||
$cache->setOption('automatic_serialization', true);
|
$cache->setOption('automatic_serialization', true);
|
||||||
|
|
||||||
|
// Map 0 to null for unlimited lifetime
|
||||||
|
$lifetime = \Config::inst()->get(get_class($this), 'cache_lifetime') ?: null;
|
||||||
|
$cache->setLifetime($lifetime);
|
||||||
return $cache;
|
return $cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,3 +60,7 @@ Another important variable is the `RateLimitFilter.lock_timeout` config, which i
|
|||||||
This should be increased on sites which may be slow to generate page versions, whether due to lower
|
This should be increased on sites which may be slow to generate page versions, whether due to lower
|
||||||
server capacity or volume of content (number of page versions). Requests to this page after the timeout
|
server capacity or volume of content (number of page versions). Requests to this page after the timeout
|
||||||
will not trigger any rate limit safeguard, so you should be sure that this is set to an appropriate level.
|
will not trigger any rate limit safeguard, so you should be sure that this is set to an appropriate level.
|
||||||
|
|
||||||
|
You can set the `ContentFilter.cache_lifetime` config in order to control the maximum age of the cache.
|
||||||
|
This is an integer value in seconds, and defaults to 300 (five minutes). Set it to 0 or null to make this
|
||||||
|
cache unlimited.
|
Loading…
Reference in New Issue
Block a user