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

caddy-reverse-proxy: loading png-images hangs for 5 seconds #5936

Closed
3gb1e opened this issue Nov 12, 2023 · 4 comments
Closed

caddy-reverse-proxy: loading png-images hangs for 5 seconds #5936

3gb1e opened this issue Nov 12, 2023 · 4 comments
Labels
question ❔ Help is being requested

Comments

@3gb1e
Copy link

3gb1e commented Nov 12, 2023

Hi there,
I am running a caddy-reverse-proxy in a podman-container (v2.7.5) behind a podman-apache-container. Loading a png-image (less than 100kB; either inside html and as raw file) results in loading and displaying 12% of the image as fast as expected. Then it hangs for about 5 to 6 seconds, then the rest of the file will be loaded as fast as expected.
The issue occurs with all browsers, I tested with chromium, firefox, curl and wget.

The issue occurs only with png, not with jpg, gif or html-content.
Once the image lies in cache, loading time is as expected.

I think it's because of caddy as loading the png-image is
-> fast with development-apache-container (podman) directly connected
-> fast with production-apache-container (podman) directly connected to the port on server
-> slow as described with production-apache-container (podman) behind caddy-reverse-proxy running in a container (podman) on server

Somewhere I read about KeepAlive. I switched it off in apache and caddy: no success.

Caddyfile:

abc.de {
        reverse_proxy xyz-server:18002
}

www.abc.de {
        redir https://abc.de{uri}
}

Any hints would be appreciated!
Egbert

@mohammed90
Copy link
Member

Thanks for your question, and we're thrilled that you're using Caddy! This looks a buffering problem rather than a bug report or feature request.

Since this issue tracker is reserved for actionable development items, I'm going to close this, but we have a community forum where more people will be exposed to your question, including people who may be more expert or experienced with the specific question you're facing. I hope you'll ask your question there, and thanks for understanding! Please don't forget to fill out the template.

@mohammed90 mohammed90 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2023
@francislavoie francislavoie added the question ❔ Help is being requested label Nov 13, 2023
@dmd
Copy link

dmd commented Jan 29, 2024

Exact same issue here. @3gb1e did you find a solution? Posting here because the community forum thread is now locked with no resolution, and I wanted to reach you.

@3gb1e
Copy link
Author

3gb1e commented Jan 29, 2024

I posted the solution in the caddy community forum: https://caddy.community/t/slow-load-5-seconds-only-with-png-images/21730/12

TLDR: Use --network=host instead of the default --network=slirp4netns in podman. In order to use rootless podman you have to make caddy listen on unprivileged ports using the caddy directives http_port 8080 and https_port 4443.

@dmd
Copy link

dmd commented Jan 30, 2024

Aha! That does work (in Docker, for me). Pity though because I definitely do not want to run my containers in net host mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question ❔ Help is being requested
Projects
None yet
Development

No branches or pull requests

4 participants