My hero! What it I just want to access them outside of the "app." context?
My hero! What it I just want to access them outside of the "app." context?
app scope, then store it in a globalno_minimal_subrequests did not seem to work
async fn main(req: Request, env: Env, ctx: Context) -> Result<Response> {
let cache = Cache::default();
let path = "http://www.google.com";
let response: Option<Response> = cache.get(path.clone(), false).await?;
console_log!("here!");
match response {
Some(response) => {
let mut resp: Response = Response::ok("Cache hit")?;
Ok(resp)
},
None => {
console_log!("{}", path);
let mut resp = Response::ok("Cache miss")?;
Ok(resp)
}
}
}