This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier ee346bbc22 merged branch KingCrunch/feature/static-template-cache (PR #6083)
This PR was squashed before being merged into the master branch (closes #6083).

Commits
-------

6236c18 [FrameworkBundle] Added caching to TemplateController

Discussion
----------

[FrameworkBundle] Added caching to TemplateController

Because the main purpose for the `TemplateController` 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

---------------------------------------------------------------------------

by pierredup at 2012-11-21T20:24:53Z

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

---------------------------------------------------------------------------

by KingCrunch at 2012-11-21T20:38:54Z

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).

---------------------------------------------------------------------------

by pierredup at 2012-11-21T20:48:19Z

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

---------------------------------------------------------------------------

by pierredup at 2012-11-21T20:52:01Z

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

---------------------------------------------------------------------------

by KingCrunch at 2012-11-23T21:12:45Z

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.

---------------------------------------------------------------------------

by fabpot at 2012-12-03T22:18:51Z

Can you make a PR for the docs? (symfony/symfony-docs). Thanks.
2012-12-06 09:57:25 +01:00
src/Symfony merged branch KingCrunch/feature/static-template-cache (PR #6083) 2012-12-06 09:57:25 +01:00
.editorconfig Add EditorConfig File 2012-06-16 14:08:15 +02:00
.gitignore ignore composer.phar 2012-04-20 14:10:06 +01:00
.travis.yml [travis-ci] Zend Garbage Collection only for PHP5.4 2012-11-19 15:21:43 +01:00
autoload.php.dist [travis-ci] Zend Garbage Collection only for PHP5.4 2012-11-19 15:21:43 +01:00
CHANGELOG-2.0.md updated CHANGELOG for 2.0.19 2012-11-29 12:35:10 +01:00
CHANGELOG-2.1.md updated CHANGELOG for 2.1.4 2012-11-29 12:55:41 +01:00
composer.json Add missing symfony/stopwatch in the replace section of composer.json 2012-11-10 18:59:49 +01:00
CONTRIBUTING.md Create CONTRIBUTING.md file for auto-linking in PR's 2012-09-17 14:40:53 -04:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.0.19 2012-11-29 12:35:34 +01:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
phpunit.xml.dist [Locale] fixed tests 2012-12-05 14:13:56 +01:00
README.md Point to information on how to run the test suite. (closes #5405) 2012-09-01 08:52:18 +02:00
UPGRADE-2.1.md Merge branch '2.1' 2012-11-29 11:32:45 +01:00
UPGRADE-2.2.md merged branch Tobion/collection-flat (PR #6120) 2012-12-05 16:37:03 +01:00

README

Build Status

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.3 and up.

Be warned that PHP versions before 5.3.8 are known to be buggy and might not work for you:

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.

Running Symfony2 Tests

Information on how to run the Symfony2 test suite can be found in the Running Symfony2 Tests section.