mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Add runtime caching for fonts.
This commit is contained in:
		
							parent
							
								
									5d8ae14db7
								
							
						
					
					
						commit
						6f1bb9445d
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -18,6 +18,22 @@ export default defineConfig({
 | 
			
		|||
            registerType: "autoUpdate",
 | 
			
		||||
            workbox: {
 | 
			
		||||
                globPatterns: ["**/*.{js,css,html,ico,svg,png}", "manifest.webmanifest"],
 | 
			
		||||
                runtimeCaching: [
 | 
			
		||||
                    {
 | 
			
		||||
                        urlPattern: /https:\/\/[a-zA-Z./0-9_]*\.(?:otf|ttf)/i,
 | 
			
		||||
                        handler: "CacheFirst",
 | 
			
		||||
                        options: {
 | 
			
		||||
                            cacheName: "fonts-cache",
 | 
			
		||||
                            expiration: {
 | 
			
		||||
                                maxEntries: 10,
 | 
			
		||||
                                maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
 | 
			
		||||
                            },
 | 
			
		||||
                            cacheableResponse: {
 | 
			
		||||
                                statuses: [0, 200],
 | 
			
		||||
                            },
 | 
			
		||||
                        },
 | 
			
		||||
                    },
 | 
			
		||||
                ],
 | 
			
		||||
            },
 | 
			
		||||
            manifest: {
 | 
			
		||||
                name: "Piped",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue