mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 04:28:34 +01:00
add page cache owo
This commit is contained in:
parent
abba478763
commit
424a6fb789
1 changed files with 9 additions and 0 deletions
|
@ -134,6 +134,15 @@ this is our config file,you can change stuff here
|
|||
); // cache header
|
||||
res.setHeader("poketube-cacher", "STATIC_FILES");
|
||||
}
|
||||
|
||||
const a = config.cacher_max_age + 8000
|
||||
if (!req.url.match(/^\/(css|js|img|font)\/.+/)) {
|
||||
res.setHeader(
|
||||
"Cache-Control",
|
||||
"public, max-age=" + a
|
||||
); // cache header
|
||||
res.setHeader("poketube-cacher", "PAGE");
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue