mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Add Cache-Control header to api responses
This commit is contained in:
parent
e1a5a610bb
commit
edaa30f7b1
2 changed files with 10 additions and 5 deletions
|
|
@ -62,26 +62,30 @@ const trackerHeaders = [
|
|||
const apiHeaders = [
|
||||
{
|
||||
key: 'Access-Control-Allow-Origin',
|
||||
value: '*'
|
||||
value: '*',
|
||||
},
|
||||
{
|
||||
key: 'Access-Control-Allow-Headers',
|
||||
value: '*'
|
||||
value: '*',
|
||||
},
|
||||
{
|
||||
key: 'Access-Control-Allow-Methods',
|
||||
value: 'GET, DELETE, POST, PUT'
|
||||
value: 'GET, DELETE, POST, PUT',
|
||||
},
|
||||
{
|
||||
key: 'Access-Control-Max-Age',
|
||||
value: corsMaxAge || '86400'
|
||||
value: corsMaxAge || '86400',
|
||||
},
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: 'no-cache',
|
||||
},
|
||||
];
|
||||
|
||||
const headers = [
|
||||
{
|
||||
source: '/api/:path*',
|
||||
headers: apiHeaders
|
||||
headers: apiHeaders,
|
||||
},
|
||||
{
|
||||
source: '/:path*',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue