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
FrankenPHP response isn't gzipped? #707
Comments
Sorry to leave you hanging for so long, I've been curious how this is going on. Are you using the default caddyfile? Can you share your request headers? Particularly the Accept-Encoding headers? |
Also, how are you running this? Are you running this in a docker container or cli? If a cli, can you share the incantation? If a docker container, can you share the docker file? |
Hi, @withinboredom 👋 . It's running within a Docker container. Everything is pretty much the default. Here is the FROM dunglas/frankenphp:latest-php8.2
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
RUN install-php-extensions \
bcmath \
exif \
gd \
intl \
mysqli \
zip \
imagick \
opcache
COPY --from=wordpress /usr/local/etc/php/conf.d/* /usr/local/etc/php/conf.d/
COPY --from=wordpress /usr/local/bin/docker-entrypoint.sh /usr/local/bin/
COPY --from=wordpress --chown=root:root /usr/src/wordpress /usr/src/wordpress
WORKDIR /var/www/html
VOLUME /var/www/html
ARG USER=www-data
RUN chown -R ${USER}:${USER} /data/caddy && chown -R ${USER}:${USER} /config/caddy
RUN sed -i \
-e 's/\[ "$1" = '\''php-fpm'\'' \]/\[\[ "$1" == frankenphp* \]\]/g' \
-e 's/php-fpm/frankenphp/g' \
/usr/local/bin/docker-entrypoint.sh
USER ${USER}
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["frankenphp", "run", "--config", "/etc/caddy/Caddyfile"] And the Caddyfile.
|
Thank you! What are your request headers? I'd like to reproduce this and see what is going on. |
@withinboredom thanks for looking into this. Here is the request header:
|
Yeah, this one is weird. Doing a local build of frankenphp, I see encoding working correctly. But it isn't in the docker image or static build from the latest release. Simplest repoducer: <?php
#test.php
header('Content-Type: text/plain');
ksort($_SERVER);
var_dump($_SERVER);
You should see the following output:
@dunglas any idea why CI builds wouldn't be encoding output? I'm kinda scratching my head on this one. |
Is the |
Same payload in both cases, very strange |
I cannot reproduce the issue on Mac using the official Docker image (Linux ARM) or the Mac ARM binary running directly on the host. |
hey! I’m a little late. i know gzip is working correctly on the frankenwp image. Have you checked this repo? |
I am closing for now as we haven't reproduced the issue yet. Feel free to reopen if you can provide a minimal reproducer. |
What happened?
While testing WordPress with FrankenPHP, I noticed that the response isn't actually gzipped? Take a look at these screenshots:
As we can see there, the size of the document in FrankenPHP's response is significantly larger compared to WordPress with Apache below.👇
Both configurations are using the stock configuration from Docker WordPress and FrankenPHP. The only difference is that HTTPS redirect is disabled. Is there anything we need to configure to make it work similarly to WordPress with Apache? It would be great if we could also get the missing headers:
Content-Encoding
andContent-Length
.Build Type
Docker (Debian Bookworm)
Worker Mode
No
Operating System
macOS
CPU Architecture
Apple Silicon
PHP configuration
Relevant log output
No response
The text was updated successfully, but these errors were encountered: