Skip to content

add support for appending no-cache to Cache-Control header #35720

@anadimisra

Description

@anadimisra

Description
While using Symphony in Laravel, we set response headers for GET requests through a middleware cache.headers

Route::resource('blogs', 'BlogPostController')->except('create','edit')->middleware('cache.headers:private;max_age=86400;etag');

If I add no_cache then it breaks the response, and I get the error

Response does not support the following options: "no-cache".

The error led me to following block of code in Symfony\Component\HttpFoundation

if ($diff = array_diff(array_keys($options), ['etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public', 'immutable'])) {
throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', $diff)));
}

adding no_cache support will be really helpful.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions