Final Class Yiisoft\HttpMiddleware\HttpCache\ETagHeader
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| headerValue() | Returns the ETag value formatted for use in HTTP headers. | Yiisoft\ |
| rawValue() | Returns the raw ETag value generated from the seed. | Yiisoft\ |
Method Details
public function __construct(
private readonly ETag $eTag,
private readonly ETagGeneratorInterface $generator,
) {}
Returns the ETag value formatted for use in HTTP headers.
The value is enclosed in double quotes and prefixed with 'W/' if the ETag is weak.
| public string headerValue ( ) | ||
| return | string |
The formatted ETag header value. |
|---|---|---|
public function headerValue(): string
{
$value = '"' . $this->rawValue() . '"';
if ($this->eTag->weak) {
$value = 'W/' . $value;
}
return $value;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.