Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
http_cache_failure.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
20 
21 #ifndef NET_INSTAWEB_HTTP_PUBLIC_HTTP_CACHE_FAILURE_H_
22 #define NET_INSTAWEB_HTTP_PUBLIC_HTTP_CACHE_FAILURE_H_
23 
27 
28 namespace net_instaweb {
29 
34  kFetchStatusNotSet = 0,
35  kFetchStatusOK = 1,
36  kFetchStatusUncacheable200 = 2,
37  kFetchStatusUncacheableError = 3,
38  kFetchStatus4xxError = 4,
39  kFetchStatusOtherError = 5,
40  kFetchStatusDropped = 6,
41  kFetchStatusEmpty = 7
44 };
45 
48 
52 };
53 
55  public:
63  const ResponseHeaders& headers,
64  StringPiece contents,
65  bool physical_fetch_success,
66  bool external_cacheable);
67 
69  static bool IsFailureCachingStatus(HttpStatus::Code code);
70 
73  static FetchResponseStatus DecodeFailureCachingStatus(HttpStatus::Code code);
74  static HttpStatus::Code EncodeFailureCachingStatus(
75  FetchResponseStatus status);
76 };
77 
78 }
79 
80 #endif
static bool IsFailureCachingStatus(HttpStatus::Code code)
Returns true if the given status code is used to remember failure.
static FetchResponseStatus ClassifyFailure(const ResponseHeaders &headers, StringPiece contents, bool physical_fetch_success, bool external_cacheable)
Read/write API for HTTP response headers.
Definition: response_headers.h:37
static FetchResponseStatus DecodeFailureCachingStatus(HttpStatus::Code code)
int ttl_sec_for_status[8]
Definition: http_cache_failure.h:51
Definition: http_cache_failure.h:46
FetchResponseStatus
Definition: http_cache_failure.h:33
Definition: http_cache_failure.h:54