mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-01 05:37:19 +01:00
add page cache owo
This commit is contained in:
parent
4840d52749
commit
4dbb7d1852
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