DEV: enable CORS to all CDN get requests from workbox. (#11896)

To prevent opaque cache files, now all the CDN files will be requested in 'cors' mode if the cdn_cors_enabled global setting is enabled. Before enabling the setting, should enable the cors in the CDN server by adding the response header `access-control-allow-origin: *` or `access-control-allow-origin: https://discourse.example.com.`

And other external file requests other than CDN will not be cached if the response type is opaque.
This commit is contained in:
Vinoth Kannan
2021-02-02 11:38:29 +05:30
committed by GitHub
parent ea1ffe390b
commit 9d2eaec88f
8 changed files with 305 additions and 4 deletions

View File

@@ -31,6 +31,7 @@
"pikaday": "1.8.0",
"resumablejs": "1.1.0",
"spectrum-colorpicker": "1.8.0",
"workbox-cacheable-response": "^4.3.1",
"workbox-core": "^4.3.1",
"workbox-expiration": "^4.3.1",
"workbox-routing": "^4.3.1",