bypass cache from frigate frontend, reduce to 5s

This commit is contained in:
Blake Blackshear 2023-10-27 06:02:27 -05:00
parent 22ef7a7ae8
commit 140b5fd5df
2 changed files with 4 additions and 1 deletions

View File

@ -190,7 +190,9 @@ http {
proxy_cache api_cache; proxy_cache api_cache;
proxy_cache_lock on; proxy_cache_lock on;
proxy_cache_use_stale updating; proxy_cache_use_stale updating;
proxy_cache_valid any 10s; proxy_cache_valid any 5s;
proxy_cache_bypass $http_x_cache_bypass;
add_header X-Cache-Status $upstream_cache_status;
location /api/stats { location /api/stats {
access_log off; access_log off;

View File

@ -7,6 +7,7 @@ import axios from 'axios';
axios.defaults.baseURL = `${baseUrl}api/`; axios.defaults.baseURL = `${baseUrl}api/`;
axios.defaults.headers.common = { axios.defaults.headers.common = {
'X-CSRF-TOKEN': 1, 'X-CSRF-TOKEN': 1,
'X-CACHE-BYPASS': 1,
}; };
export function ApiProvider({ children, options }) { export function ApiProvider({ children, options }) {