Skip to content

Commit 2e98545

Browse files
authored
feat: explain how to enable Server Push with Caddy (#1530)
1 parent a2c23b6 commit 2e98545

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/push-relations.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
API Platform leverages this capability by pushing relations of a resource to clients.
88

99
**Note:** We strongly recommend using [Vulcain](https://vulcain.rocks) instead of this feature.
10-
Vulcain is faster, cleaner, more flexible, and is supported out of the box in the API Platform distribution.
10+
Vulcain is faster, cleaner, more flexible, and is supported out of the box in [the API Platform distribution](../distribution/index.md).
1111

1212
```php
1313
<?php
@@ -28,7 +28,10 @@ class Book
2828
```
2929

3030
By setting the `push` attribute to `true` on a property holding a relation, API Platform will automatically add a valid `Link` HTTP header with the `preload` relation.
31-
According to the [Preload W3C Candidate Recommendation](https://www.w3.org/TR/preload/), web servers and proxy servers can read this header, fetch the related resource and send it to the client using Server Push.
31+
According to the [Preload W3C Candidate Recommendation](https://www.w3.org/TR/preload/#server-push-http-2), web servers and proxy servers can read this header, fetch the related resource and send it to the client using Server Push.
32+
33+
With the Caddy web server (the server shipped as part of the [distribution](../distribution/index.md)), you must add [the `push` directive](https://caddyserver.com/docs/caddyfile/directives/push) to your `Caddyfile` to be able to use this feature.
34+
3235
[NGINX](https://www.nginx.com/blog/nginx-1-13-9-http2-server-push/), [Apache](https://httpd.apache.org/docs/current/howto/http2.html#push), [Cloudflare](https://www.cloudflare.com/website-optimization/http2/serverpush/), [Fastly](https://docs.fastly.com/guides/performance-tuning/http2-server-push) and [Akamai](https://blogs.akamai.com/2017/03/http2-server-push-the-what-how-and-why.html)
3336
honor this header.
3437

0 commit comments

Comments
 (0)