aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/http_cache.rs
diff options
context:
space:
mode:
authorGregory Terzian <gterzian@users.noreply.github.com>2017-11-18 11:21:52 +0800
committerGregory Terzian <gterzian@users.noreply.github.com>2017-11-19 13:52:13 +0800
commit6196a6e65d03e7e4f9ff857f0c2315413a41e44a (patch)
treeb51c56589a7133ad1cb4fed36084f79b167bd957 /components/net/http_cache.rs
parent5f8a310bd16b3ecbe131a516ce79afd221a95535 (diff)
downloadservo-6196a6e65d03e7e4f9ff857f0c2315413a41e44a.tar.gz
servo-6196a6e65d03e7e4f9ff857f0c2315413a41e44a.zip
add pref to disable http cache, mozilla tests
Diffstat (limited to 'components/net/http_cache.rs')
-rw-r--r--components/net/http_cache.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/net/http_cache.rs b/components/net/http_cache.rs
index c35f02a3d4d..cd0211399a0 100644
--- a/components/net/http_cache.rs
+++ b/components/net/http_cache.rs
@@ -18,6 +18,7 @@ use hyper_serde::Serde;
use net_traits::{Metadata, FetchMetadata};
use net_traits::request::Request;
use net_traits::response::{HttpsState, Response, ResponseBody};
+use servo_config::prefs::PREFS;
use servo_url::ServoUrl;
use std::collections::HashMap;
use std::str;
@@ -609,6 +610,9 @@ impl HttpCache {
/// Storing Responses in Caches.
/// <https://tools.ietf.org/html/rfc7234#section-3>
pub fn store(&mut self, request: &Request, response: &Response) {
+ if PREFS.get("network.http-cache.disabled").as_boolean().unwrap_or(false) {
+ return
+ }
if request.method != Method::Get {
// Only Get requests are cached.
return