Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NewDot image preflight request caching #37431

Closed
Beamanator opened this issue Feb 28, 2024 · 4 comments
Closed

Add NewDot image preflight request caching #37431

Beamanator opened this issue Feb 28, 2024 · 4 comments
Assignees
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review Weekly KSv2

Comments

@Beamanator
Copy link
Contributor

Beamanator commented Feb 28, 2024

Problem

#36560 (comment)

I believe I've identified the issue—the preflight response isn't being cached, resulting in its repeated execution with each image render. While the images themselves are cached, the browser is forced to reinitiate the preflight check due to the absence of caching headers. These headers are crucial as they instruct the browser on whether and how long to cache the preflight request.

  • a preflight request is being made even though the actual resource is cached
    image

Consequently, in offline scenarios, the browser is unable to perform the preflight request, leading to a failure in loading all images.

Here are some visuals to illustrate the point:

  • Image caching example (Notice how the GET response for the image is cached):
    Image caching example

  • Preflight request missing caching headers:
    Preflight request missing caching headers

Solution

To fix the issue in offline usage, and omit doing preflight request for cached items we should add some cache to the preflight response as well (this is a backend task)

cc @trjExpensify since you're helping coordinate this effort as BugZero

cc @kidroca since the above P / S was written by you 🙏

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d9de82c0447606ee
  • Upwork Job ID: 1762857975561478144
  • Last Price Increase: 2024-02-28
@Beamanator Beamanator added Engineering Weekly KSv2 Internal Requires API changes or must be handled by Expensify staff labels Feb 28, 2024
Copy link

melvin-bot bot commented Feb 28, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01d9de82c0447606ee

Copy link

melvin-bot bot commented Feb 28, 2024

Triggered auto assignment to Contributor Plus for review of internal employee PR - @eh2077 (Internal)

@trjExpensify trjExpensify self-assigned this Feb 28, 2024
@trjExpensify
Copy link
Contributor

I'll self assign to BZ this one as well.

@justinpersaud
Copy link
Contributor

PR is up for review.

@justinpersaud justinpersaud added the Reviewing Has a PR in review label Mar 1, 2024
@eh2077 eh2077 removed their assignment Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

4 participants