The WebLink Symfony component manages links between HTTP resources. It helps applications emit preload, prefetch, and push hints aligned with web standards.
Overview
WebLink is a Symfony package for declaring and serializing links between resources in HTTP responses. It focuses on performance-oriented hints such as advising clients to preload or prefetch documents, including use with HTTP and HTTP/2 server push patterns.
The component implements HTML5 link, preload, and resource-hints specifications, optional HTML5 link-type extensions, RFC 8288 web linking, Linkset document formats from RFC 9264, and the Link-Template header field from RFC 9652. It also relates to PSR-13 linking interfaces used in PHP ecosystems.
Teams install it through Composer into PHP applications, commonly as part of Symfony or standalone in projects like CMS and commerce stacks that list the package among dependencies. Documentation on the Symfony site describes API usage; the package itself is a library imported into application code rather than a standalone runnable product.
Key features
- HTTP link relation management
- Preload and prefetch hint support
- HTML5 link and resource hints specs
- RFC 8288 web linking support
- Linkset document format support
- Link-Template header support
- Composer package for PHP projects
- PSR-13-related linking utilities
Use cases
- Adding preload headers in Symfony apps
- HTTP/2 push hint generation
- Standards-based link serialization
- Performance tuning for web responses