Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

fix(devCdn): only cache 200's #1245

Merged
merged 6 commits into from
Feb 1, 2024
Merged

fix(devCdn): only cache 200's #1245

merged 6 commits into from
Feb 1, 2024

Conversation

code-forger
Copy link
Member

Description

Prevent the caching and re-playing of non 200 reponses.

Motivation and Context

if there is a non-200 reponse, the cache will re-play the text content as a '200'. This means errors are stored in the cache and re-played incorrectly.

Simply do not cache the non 200

How Has This Been Tested?

TBT

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)
  • Dependency update
  • Security update

Checklist:

  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • These changes should be applied to a maintenance branch.
  • This change requires cross browser checks.
  • Performance tests should be ran against the server prior to merging.
  • This change impacts caching for client browsers.
  • This change impacts HTTP headers.
  • This change adds additional environment variable requirements for One App users.
  • I have added the Apache 2.0 license header to any new files created.

What is the Impact to Developers Using One App?

@code-forger code-forger requested review from a team as code owners January 22, 2024 15:25
Copy link
Contributor

github-actions bot commented Jan 22, 2024

Size Change: 0 B

Total Size: 712 kB

ℹ️ View Unchanged
Filename Size
./build/app/app.js 164 kB
./build/app/app~vendors.js 411 kB
./build/app/runtime.js 7.07 kB
./build/app/service-worker-client.js 7.25 kB
./build/app/vendors.js 123 kB

compressed-size-action

Copy link
Member

@smackfu smackfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would cache anything that is ok == true but then you would have to cache the status too.

@smackfu smackfu requested a review from a team January 22, 2024 15:31
@code-forger
Copy link
Member Author

Ideally we would cache anything that is ok == true but then you would have to cache the status too.

Thats a better approach, will use that

@smackfu
Copy link
Member

smackfu commented Jan 22, 2024

Something to consider is that there is a single cache across the whole system, so any changes to the cache file have to be backwards compatible. Which may make it impossible to cache status.

@10xLaCroixDrinker
Copy link
Member

Ideally we would cache anything that is ok == true but then you would have to cache the status too.

Thats a better approach, will use that

@code-forger are you making this change?

@code-forger
Copy link
Member Author

@smackfu @10xLaCroixDrinker

On second look, I think caching the status code is to much for this simple cache.

This is a CDN cache, the CDN should always be responding with 200's, I don't see any other 2XX code it would be useful to cache.

@smackfu
Copy link
Member

smackfu commented Jan 31, 2024

On second look, I think caching the status code is to much for this simple cache.

Agreed. Also it's not worth changing the cache format given the lack of benefit.

@10xLaCroixDrinker 10xLaCroixDrinker merged commit 46fd30d into main Feb 1, 2024
9 checks passed
@10xLaCroixDrinker 10xLaCroixDrinker deleted the code-forger-patch-1 branch February 1, 2024 01:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants