first commit
This commit is contained in:
commit
3c0479faf0
169 files changed
+27617
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { defineConfig } from '@adonisjs/static'
|
||||
|
||||
/**
|
||||
* Serves the Angular build copied in "public/". The bundles have a hash
|
||||
* in their name and can be cached forever, index.html must not be cached.
|
||||
*
|
||||
* https://docs.adonisjs.com/guides/static-assets
|
||||
*/
|
||||
const staticServerConfig = defineConfig({
|
||||
enabled: true,
|
||||
etag: true,
|
||||
lastModified: true,
|
||||
dotFiles: 'ignore',
|
||||
headers: (path) => {
|
||||
if (/(^|[\\/])(main|chunk|styles|polyfills)-[\w-]{8,}\.(js|css)$/.test(path)) {
|
||||
return { 'Cache-Control': 'public, max-age=31536000, immutable' }
|
||||
}
|
||||
return { 'Cache-Control': 'no-cache' }
|
||||
},
|
||||
})
|
||||
|
||||
export default staticServerConfig
|
||||
Reference in new issue
Block a user