Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion caddy/frankenphp/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#}

root {$SERVER_ROOT:public/}
encode zstd br gzip
# Compressed SSE streams cost memory per subscriber and enable BREACH-style attacks.
@compressible not path /.well-known/mercure
encode @compressible zstd br gzip

# Uncomment the following lines to enable Mercure and Vulcain modules
#mercure {
Expand Down
8 changes: 8 additions & 0 deletions docs/mercure.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ Access tokens must carry the identifier of the `issuer` they were signed by in t
>
> Uncomment the Mercure section in `/etc/frankenphp/Caddyfile` to enable it.

If you enable compression with the `encode` directive, exclude the hub from it:
compressed SSE streams cost memory per subscriber and enable BREACH-style attacks.

```caddyfile
@compressible not path /.well-known/mercure
encode @compressible zstd br gzip
```

### With `php-server`

`frankenphp php-server --mercure` starts the hub without a `Caddyfile`, configured by environment variables:
Expand Down
Loading