Cache url preview
This commit is contained in:
		
							parent
							
								
									87d9bbd040
								
							
						
					
					
						commit
						fde2782a9e
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -5,6 +5,10 @@ module.exports = async (ctx: Koa.Context) => {
 | 
				
			||||||
	const summary = await summaly(ctx.query.url);
 | 
						const summary = await summaly(ctx.query.url);
 | 
				
			||||||
	summary.icon = wrap(summary.icon);
 | 
						summary.icon = wrap(summary.icon);
 | 
				
			||||||
	summary.thumbnail = wrap(summary.thumbnail);
 | 
						summary.thumbnail = wrap(summary.thumbnail);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Cache 7days
 | 
				
			||||||
 | 
						ctx.set('Cache-Control', 'max-age=604800, immutable');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx.body = summary;
 | 
						ctx.body = summary;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue