Skip to content
Snippets Groups Projects
Commit fde2782a authored by syuilo's avatar syuilo
Browse files

Cache url preview

parent 87d9bbd0
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,10 @@ module.exports = async (ctx: Koa.Context) => {
const summary = await summaly(ctx.query.url);
summary.icon = wrap(summary.icon);
summary.thumbnail = wrap(summary.thumbnail);
// Cache 7days
ctx.set('Cache-Control', 'max-age=604800, immutable');
ctx.body = summary;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment