File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ use super::error::Nope;
13
13
use super :: page:: Page ;
14
14
use rustc_serialize:: json:: { Json , ToJson } ;
15
15
use std:: collections:: BTreeMap ;
16
- use iron:: headers:: { Expires , HttpDate } ;
16
+ use iron:: headers:: { Expires , HttpDate , CacheControl , CacheDirective } ;
17
17
use time;
18
18
19
19
@@ -139,7 +139,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
139
139
}
140
140
path
141
141
} ;
142
-
142
+
143
143
// don't touch anything other than html files
144
144
if !path. ends_with ( ".html" ) {
145
145
return Err ( IronError :: new ( Nope :: ResourceNotFound , status:: NotFound ) ) ;
@@ -265,5 +265,8 @@ pub fn badge_handler(req: &mut Request) -> IronResult<Response> {
265
265
let mut resp = Response :: with ( ( status:: Ok , Badge :: new ( options) . unwrap ( ) . to_svg ( ) ) ) ;
266
266
resp. headers . set ( ContentType ( "image/svg+xml" . parse ( ) . unwrap ( ) ) ) ;
267
267
resp. headers . set ( Expires ( HttpDate ( time:: now ( ) ) ) ) ;
268
+ resp. headers . set ( CacheControl ( vec ! [ CacheDirective :: NoCache ,
269
+ CacheDirective :: NoStore ,
270
+ CacheDirective :: MustRevalidate ] ) ) ;
268
271
Ok ( resp)
269
272
}
You can’t perform that action at this time.
0 commit comments