Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Auto add the cache-control headers? #25736

Copy link
Copy link
Closed
@devgogo

Description

@devgogo
Issue body actions
Q A
Bug report? Maybe
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.0.3

hello everybody,

I need my CDN service cache my website, so I set

    /**
     * @Route("/", defaults={"page": 1}, name="homepage")
     * @Method("GET")
     * @Cache(smaxage="3600")
     */
    public function indexAction(ArticleRepository $articles, int $page): Response
    {
        $articles = $articles->findLatest($page);

        return $this->render('article/index.html.twig', [
            'articles' => $articles
        ]);
    }

then the cache-control header is cache-control:max-age=0, must-revalidate, private, s-maxage=3600

It contains the max-age=0, must-revalidate, private is not what I want.

What should I do?

Because the response header, so my CDN cannot cache my pages.

thx.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.