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

Cloudflare and cached loading page resulting in javascript/mime errors #388

Open
valankar opened this issue Sep 6, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@valankar
Copy link
Contributor

valankar commented Sep 6, 2024

Describe the bug
I'm running Sablier via Caddy behind a Cloudflare tunnel. My app is a FastAPI/NiceGUI Python app, which retrieves .js files. It generally works well most of the time, but sometimes I get a bunch of errors with the .js files actually returning the Sablier loading page HTML. It looks like the following:

js errors

When I go to inspect those .js files in the browser, it appears the text is actually the Sablier loading page:

js errors 2

    <h1><span>Starting </span> <span class="error_code"></span>...</h1>
    <p class="output"><span>Your instance(s) will stop after 6 hours of inactivity</span>.</p>
...

What I think is happening is Cloudflare is caching that loading page and returning it for all requests, even after the container is up. I notice the page doesn't have any headers to affect caching. Shouldn't it have some to instruct clients not cache it?

Context

  • Sablier version: v1.8.0-beta.18
  • Provider: Docker version 27.2.0, build 3ab4256
  • Reverse proxy: caddy
  • Sablier running inside a container? yes

Expected behavior
Maybe the Sablier loading page should specifically have no cache headers.

@valankar valankar added the bug Something isn't working label Sep 6, 2024
@acouvreur
Copy link
Member

Hello @valankar that's actually a pretty good point!

Do you think you could submit such fix ?

@valankar
Copy link
Contributor Author

valankar commented Sep 6, 2024

Sure I'll do some tests with https://github.com/acouvreur/sablier/blob/main/docs/themes.md first.

@acouvreur
Copy link
Member

@valankar any feedback on the released version ? Does it work as expected ?

@valankar
Copy link
Contributor Author

It still unfortunately happens around 5% of the time, usually when I hit my website on my phone (Safari). It's rather difficult to debug. I know that NiceGUI/FastAPI use websockets, so perhaps using dynamic strategy is not the right thing. Everything works fine with blocking strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants