hubspot-cms-sync 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/build-static.mjs +5 -2
package/package.json
CHANGED
package/src/build-static.mjs
CHANGED
|
@@ -166,10 +166,13 @@ export async function buildStatic({ siteDir, outDir, baseUrl = '', assetBase = '
|
|
|
166
166
|
redirectCount = lines.length;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
// /assets/* are content-hashed, so immutable is safe. css/js use STABLE filenames, so
|
|
170
|
+
// immutable would pin stale styles at the edge for a year after a deploy — they must
|
|
171
|
+
// revalidate instead (cheap 304s) so CSS/JS fixes actually reach users.
|
|
169
172
|
await writeFile(join(outDir, '_headers'),
|
|
170
173
|
'/assets/*\n Cache-Control: public, max-age=31536000, immutable\n'
|
|
171
|
-
+ '/css/*\n Cache-Control: public, max-age=
|
|
172
|
-
+ '/js/*\n Cache-Control: public, max-age=
|
|
174
|
+
+ '/css/*\n Cache-Control: public, max-age=0, must-revalidate\n'
|
|
175
|
+
+ '/js/*\n Cache-Control: public, max-age=0, must-revalidate\n'
|
|
173
176
|
+ '/*\n X-Content-Type-Options: nosniff\n X-Frame-Options: SAMEORIGIN\n Referrer-Policy: strict-origin-when-cross-origin\n',
|
|
174
177
|
'utf8');
|
|
175
178
|
|