Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[FrameworkBundle] Added caching to TemplateController#6083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
kingcrunch wants to merge4 commits intosymfony:masterfromkingcrunch:feature/static-template-cache
Closed

[FrameworkBundle] Added caching to TemplateController#6083

kingcrunch wants to merge4 commits intosymfony:masterfromkingcrunch:feature/static-template-cache

Conversation

@kingcrunch
Copy link
Contributor

Because the main purpose for theTemplateController seems to be to render static pages like "disclaimer" and such, it seems useful to allow caching.

imprint:    pattern: /imprint    defaults:        _controller: SymfonyFrameworkBundle:Template:template        template: "::pages/imprint.html.twig"        maxAge: 86400

@pierredup
Copy link
Contributor

IMHO I think the caching should be allowed to be set optionally

@kingcrunch
Copy link
ContributorAuthor

I wrote it this way, because I assume, that it will cover more use-cases, than the other way round, but you are right, that this will change the current behaviour. Would like to hear other opinions, because I don't think one uses this action for anything else than fully-static content (means: The current behaviour doesn't feel very useful to me).

@pierredup
Copy link
Contributor

I totally agree, but I would then suggest keep the caching on by default, but have the option to turn it off if necessary

@pierredup
Copy link
Contributor

Actually I think to have caching permanently enabled for static content would probably be the best scenario, but I like to think in terms of flexibility and specific user requirements. It would be great to get some opinions from others on this

@kingcrunch
Copy link
ContributorAuthor

I thought about it and I come to the conclusion, that it is probably a not so good idea to enable caching by default, because ... well, it's not possible to disable it again. I guess something like this

{{ render '@AcmeBundle:ArticleController:latest' with {count: 1} }}

may be not so uncommon as I suggested in the first commit.

Changed bevahiour:- No caching by default- Implicit public caching, whe one of maxAge or sharedAge is set- Explicit private caching, when private is set and evaluates to true- Explicit public caching, when private is set and evaluates to false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

should beBoolean instead ofbool

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just curious:Boolean, but notInteger?

@fabpot
Copy link
Member

Can you make a PR for the docs? (symfony/symfony-docs). Thanks.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@kingcrunch@pierredup@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp