mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
9903cf1090
## About the changes Current state, when returning the HTML entry point from the server, there are no headers attached. We encountered an issue with a deployment and this had an impact for us. A brief description: 1. We deployed the most recent version. Noticed an unrelated issue. 2. Users tried to use the most recent version and due to their client cache, requested assets that did not exist in the newest version. 3. Our cache layer cached the assets that were not there with the HTML response. It had to infer the type based on the filename because there was no attached `Content-Type` header. This cache was very sticky. 4. After rolling back we saw the HTML response (from the cache) instead of the appropriate response from the upstream Unleash application. This PR does a few things. 1. When responding with the HTML entry point, it adds header (`Content-Type: text/html`). 2. When the client is requesting an asset (a path that ends with an extension), it also instructs the resource not to be cached (`Cache-Control: no-cache`) and returns a 404. This will prevent misses from getting cached. ## Discussion points To me, there doesn't seem to be a lot of test infra on serving the SPA application. If that is an error, please indicate where that is and an appropriate test can be added. |
||
---|---|---|
.. | ||
lib | ||
mailtemplates | ||
migrations | ||
test | ||
migrator.ts | ||
server-dev.ts | ||
server.ts |