-
Notifications
You must be signed in to change notification settings - Fork 25
/
config.php
117 lines (105 loc) · 4 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
/**
* This file is part of the PageCache package.
*
* @author Muhammed Mamedov <[email protected]>
* @copyright 2016
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* Example configuration file
*
* Sample config array with all possible values.
* Copy this configuration file to your local location and edit values that you need.
*
* You do not need to copy this config file and use it, you could set up all parameters directly inside code.
* If you have caching enabled on several pages, and do not want to repeat cache settings, then config file is for you.
*
* Options `file_lock`, `cache_path` and `min_cache_file_size` are ignored if custom PSR-16 SimpleCache adapter is used.
*
* NOTE: Parameters defined here in $config array are used by all pages using PageCache within you application.
* You can override any of these settings in your code.
*
* Feel free to comment out any settings you don't need.
*
*/
return [
/**
* Minimum cache file size.
* Generated cache files less than this many bytes, are considered invalid and are regenerated
* Default 10
*/
'min_cache_file_size' => 10,
/**
* Set true to enable logging, not recommended for production use, only for debugging
* Default: false
*
* Effects both internal logger, and any external PSR-3 logger (if any) activated via setLogger() method
*/
'enable_log' => false,
/**
* Internal log file location, enable_log must be true for logging to work
* When external logger is provided via setLogger(), internal logging is disabled.
*/
'log_file_path' => __DIR__ . '/log/cache.log',
/**
* Current page's cache expiration in seconds.
* Default: 20 minutes, 1200 seconds.
*/
'cache_expiration_in_seconds' => 1200,
/**
* Cache directory location (mind the trailing slash "/").
* Cache files are saved here.
*/
'cache_path' => __DIR__ . '/cache/',
/**
* Use session support, if you have a login area or similar.
* When page content changes according to some Session value, although URL remains the same.
* Disabled by default.
*/
'use_session' => false,
/**
* Exclude $_SESSION key(s) from caching strategies. Pass session name as keys to the array.
*
* When to use: Your application changes $_SESSION['count'] variable, but that doesn't reflect on the page
* content. Exclude this variable, otherwise PageCache will generate seperate cache files for each
* value of $_SESSION['count] session variable.
* Example: 'session_exclude_keys'=>array('count')
*/
'session_exclude_keys' => [],
/**
*
* Locking mechanism to use when writing cache files. Default is LOCK_EX | LOCK_NB, which locks for
* exclusive write while being non-blocking. Set whatever you want.
* Read for details (http://php.net/manual/en/function.flock.php)
*
* Set file_lock = false to disable file locking.
*/
'file_lock' => LOCK_EX | LOCK_NB,
/**
* Send appropriate HTTP cache related headers in response or not.
* When true headers are sent, when false not being sent.
*
* When set to true:
* First call to your URL results in HTTP Response code 200.
* Consequent calls, until page expiration, will result in 304 Not Modified.
* When 304 is being returned, no content is retrieved from the server.
* This makes your application load super fast - cached content comes from web browser.
*/
'send_headers' => false,
/**
* Use Last-Modified and ETag values generated by application or not.
* Values will be fetched from the current response.
*/
'forward_headers' => false,
/**
* Dry Run Mode.
* When enabled no cache headers will be sent, no cache output will be sent.
* Cache items will be saved.
* Use this to test system.
*/
'dry_run_mode' =>false
];