-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathCacheMode.php
More file actions
78 lines (70 loc) · 2.68 KB
/
CacheMode.php
File metadata and controls
78 lines (70 loc) · 2.68 KB
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
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/compute/v1/compute.proto
namespace Google\Cloud\Compute\V1\CachePolicy;
use UnexpectedValueException;
/**
* Specifies the cache setting for all responses from this route. If not
* specified, Cloud CDN uses `CACHE_ALL_STATIC` mode.
*
* Protobuf type <code>google.cloud.compute.v1.CachePolicy.CacheMode</code>
*/
class CacheMode
{
/**
* A value indicating that the enum field is not set.
*
* Generated from protobuf enum <code>UNDEFINED_CACHE_MODE = 0;</code>
*/
const UNDEFINED_CACHE_MODE = 0;
/**
* Automatically cache static content, including common image formats,
* media (video and audio), and web assets (JavaScript and CSS).
* Requests and responses that are marked as uncacheable, as well as
* dynamic content (including HTML), will not be cached.
*
* Generated from protobuf enum <code>CACHE_ALL_STATIC = 355027945;</code>
*/
const CACHE_ALL_STATIC = 355027945;
/**
* Cache all content, ignoring any "private", "no-store" or "no-cache"
* directives in Cache-Control response headers.
* Warning: this may result in Cloud CDN caching private,
* per-user (user identifiable) content.
*
* Generated from protobuf enum <code>FORCE_CACHE_ALL = 486026928;</code>
*/
const FORCE_CACHE_ALL = 486026928;
/**
* Requires the origin to set valid caching headers to cache content.
* Responses without these headers will not be cached at the edge, and will
* require a full trip to the origin on every request, potentially impacting
* performance and increasing load on the origin server.
*
* Generated from protobuf enum <code>USE_ORIGIN_HEADERS = 55380261;</code>
*/
const USE_ORIGIN_HEADERS = 55380261;
private static $valueToName = [
self::UNDEFINED_CACHE_MODE => 'UNDEFINED_CACHE_MODE',
self::CACHE_ALL_STATIC => 'CACHE_ALL_STATIC',
self::FORCE_CACHE_ALL => 'FORCE_CACHE_ALL',
self::USE_ORIGIN_HEADERS => 'USE_ORIGIN_HEADERS',
];
public static function name($value)
{
if (!isset(self::$valueToName[$value])) {
throw new UnexpectedValueException(sprintf(
'Enum %s has no name defined for value %s', __CLASS__, $value));
}
return self::$valueToName[$value];
}
public static function value($name)
{
$const = __CLASS__ . '::' . strtoupper($name);
if (!defined($const)) {
throw new UnexpectedValueException(sprintf(
'Enum %s has no value defined for name %s', __CLASS__, $name));
}
return constant($const);
}
}