This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathconfig.example.php
79 lines (67 loc) · 2.83 KB
/
config.example.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
<?php
/**
* Don't edit the config.example.php.
* Instead modify the projects/config/upper.php and use ENV VARS
*/
return [
// Which driver?
'driver' => getenv('UPPER_DRIVER') ?: 'dummy',
// Default for Cache-control s-maxage
'defaultMaxAge' => 3600 * 24 * 7,
// Store tags locally and purge Urls
// In case the cache driver does not support tag purging
'useLocalTags' => true,
// Optional key prefix, to prevent collisions in case you're using the
// same cache store for several Craft installations.
// Keep it nice and short for the sake of readability when debugging.
// 1-8 characters, special chars get removed
'keyPrefix' => getenv('UPPER_KEY_PREFIX') ?: '',
// Optional maximum length for the cache tag header. Setting this higher will
// allow Upper to return more tags in the header. However, it will also require
// more resources on the server to store/buffer the tags. Ensure you have enough
// room in any proxy/CDN to display large headers if you raise this above 4k.
// Stored in bytes, typically as `16 * 1024` for 16KB
'maxBytesForCacheTagHeader' => null,
// Drivers settings
'drivers' => [
// Varnish config
'varnish' => [
'tagHeaderName' => 'XKEY',
'purgeHeaderName' => 'XKEY-PURGE',
'purgeUrl' => getenv('VARNISH_URL') ?: 'http://127.0.0.1:80/',
'headers' => getenv('VARNISH_HOST') ? ['Host' => getenv('VARNISH_HOST')] : [],
'softPurge' => false,
],
// Fastly config
'fastly' => [
'tagHeaderName' => 'Surrogate-Key',
'serviceId' => getenv('FASTLY_SERVICE_ID'),
'apiToken' => getenv('FASTLY_API_TOKEN'),
'domain' => getenv('FASTLY_DOMAIN'),
'softPurge' => false
],
// KeyCDN config
'keycdn' => [
'tagHeaderName' => 'Cache-Tag',
'apiKey' => getenv('KEYCDN_API_KEY'),
'zoneId' => getenv('KEYCDN_ZONE_ID'),
'zoneUrl' => getenv('KEYCDN_ZONE_URL')
],
// CloudFlare config
'cloudflare' => [
'tagHeaderName' => 'Cache-Tag',
'tagHeaderDelimiter' => ',',
'apiToken' => getenv('CLOUDFLARE_API_TOKEN'),
'zoneId' => getenv('CLOUDFLARE_ZONE_ID'),
'domain' => getenv('CLOUDFLARE_DOMAIN'),
// deprecated, do not use for new installs
'apiKey' => getenv('CLOUDFLARE_API_KEY'),
'apiEmail' => getenv('CLOUDFLARE_API_EMAIL'),
],
// Dummy driver (default)
'dummy' => [
'tagHeaderName' => 'X-CacheTag',
'logPurgeActions' => true,
]
]
];