Skip to content

Slow iframe requests to root domain (unintended cache bypass) #88

@lidel

Description

@lidel

Right now, every subdomain load makes additional request to the root domain with custom query parameter, which is effectively bypassing caches (even one from https://github.com/ipshipyard/waterworks-infra/pull/42) and forces rainbow to do work every time again.

This is why we sometimes see /config?origin being stuck in pending state:

2024-03-06_14-46

And then often resulting in 504 for the iframe:

2024-03-06_14-46_1

Solution

We should lean towards maximizing HTTP and browser cache and switch config logic from server-side /path?query to client-side #framents

  • iframe should make request to /#config of the root domain, not /config. This way already cached / response can be returned instead of bypassing caches and rainbow having to produce it again
  • ?origin query param should be replaced with frament param, e.g. /#config@origin=. ?origin will create separate cache entry per origin. /#foo is always better, works without SW being in place, URL hash fragments are not sent to HTTP server, allowing for cache reuse, but can still be read by JS running in iframe

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions