kutil_http/cache/axum/
handlers.rs1use super::{super::super::cache::*, headers::*};
2
3use ::axum::{extract::*, http::*, response::Response};
4
5pub async fn reset_cache_handler<CacheT, CacheKeyT>(State(cache): State<CacheT>) -> Response
10where
11 CacheT: Cache<CacheKeyT>,
12 CacheKeyT: CacheKey,
13{
14 tracing::info!("resetting cache");
15 cache.invalidate_all().await;
16 no_content_handler().await
17}
18
19pub async fn no_content_handler() -> Response {
21 StatusCode::NO_CONTENT.do_not_encode().do_not_cache()
22}