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

[Twig] [TwigBundle] Describe the new behaviour of twig.cache config#20951

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

Merged
javiereguiluz merged 1 commit intosymfony:7.3fromOkhoshi:ticket_20948
May 12, 2025

Conversation

Okhoshi
Copy link
Contributor

Update the description of thetwig.cache config to follow the changes implemented insymfony/symfony#54384.

Fixes#20948

cc@alexandre-daubois

@carsonbotcarsonbot added this to the7.3 milestoneMay 10, 2025
Signed-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
@carsonbotcarsonbot changed the title[TwigBundle] Describe the new behaviour of twig.cache config[Twig] [TwigBundle] Describe the new behaviour of twig.cache configMay 12, 2025
@javiereguiluzjaviereguiluz merged commitf6e6a8c intosymfony:7.3May 12, 2025
3 checks passed
@javiereguiluz
Copy link
Member

Thanks Quentin for this contribution!

I did some minor rewords while merging, but I left your core contribution intact.


I find the new docs a bit confusing so I'masking something to you.

Is the following current explanation:

When set to ``true``, the cache is stored in ``%kernel.cache_dir%/twig`` by default.However, if ``auto_reload`` is disabled and ``%kernel.build_dir%`` differs from``%kernel.cache_dir%``, the cache will be stored in ``%kernel.build_dir%/twig`` instead.

Equivalent to this simplified version?

When set to ``true``, the cache is stored in ``%kernel.cache_dir%/twig`` by default.However, if ``auto_reload`` is disabled the cache will be stored in``%kernel.build_dir%/twig`` instead.

I mean:

  • Ifauto_reload is disabled:
    • Ifbuild_dir andcache_dir are different, thenbuild_dir is used
    • Ifbuild_dir andcache_dir are the same, thencache_dir is used. BUT, if they are the same, we're usingbuild_dir
    • So, we always usebuild_dir whenauto_reload is disabled, right?

Maybe I'm missing something here.

@Okhoshi
Copy link
ContributorAuthor

@javiereguiluz It's indeed a bit confusing, because the setup is a bit more convoluted, but for the sake of simplicity, not all the details are described in the doc.

There's actually a slight difference when the cache is set tobuild_dir orcache_dir (other than the directory itself).
Ifbuild_dir is used, we construct a two layers cache with a read-only layer pointing tobuild_dir and a read/write opportunistic cache pointing tocache_dir.
Ifcache_dir is used, we set up a simple one-layer cache oncache_dir.

Hence why the distinction, even if you are actually right with the simplified version.

Happy to discuss any improvements we can make on the doc for this 👍

@OkhoshiOkhoshi deleted the ticket_20948 branchMay 12, 2025 07:03
@javiereguiluz
Copy link
Member

Thanks for the detailed explanation 🙏 I think you are right that it's better to not mention all these internal details in the docs.

Also, let's wait until Symfony usesbuild_dir for everything and it's "fully read-only" to see if we can tweak many docs at once related to that if we think it's needed.

Okhoshi reacted with thumbs up emoji

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

@OskarStarkOskarStarkOskarStark left review comments

@GromNaNGromNaNGromNaN approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

[TwigBundle] Usekernel.build_dir to store the templates known at bui…
5 participants
@Okhoshi@javiereguiluz@GromNaN@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp