Skip to content

Auto add the cache-control headers? #25736

Closed
@devgogo

Description

@devgogo
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