Git Product home page Git Product logo

Comments (14)

leofeyer avatar leofeyer commented on June 9, 2024 1

Yes. Basically the code from Contao 4.4.

static::executeCommand('cache:clear --no-warmup', $event);
static::executeCommand('cache:warmup', $event);

from manager-bundle.

leofeyer avatar leofeyer commented on June 9, 2024

cache:clear also warms up the cache. They had deprecated it for a couple of weeks but later reverted the deprecation, so it is fine to use cache:clear only.

from manager-bundle.

fritzmg avatar fritzmg commented on June 9, 2024

There still seems to be a difference. This is the state of var/cache/prod after cache:clear:

    annotations.map
    appProdProjectContainer.php
    appProdProjectContainer.php.meta
    appProdProjectContainerUrlGenerator.php
    appProdProjectContainerUrlGenerator.php.meta
    appProdProjectContainerUrlMatcher.php
    appProdProjectContainerUrlMatcher.php.meta
    Container2y5l8mc/
    contao/
    templates.php

And this is the state of the cache after cache:warmup:

    annotations.map
+   annotations.php
    appProdProjectContainer.php
    appProdProjectContainer.php.meta
    appProdProjectContainerUrlGenerator.php
    appProdProjectContainerUrlGenerator.php.meta
    appProdProjectContainerUrlMatcher.php
    appProdProjectContainerUrlMatcher.php.meta
+   bundles.map
    Container2y5l8mc/
    contao/
+   pools/
    templates.php
+   twig/

Furthermore, this is the average response time for the first request after cache:clear on my local environment:

  • 459.6ms

And this after cache:warmup:

  • 315.4ms

The latter provides an over 144ms better result.

from manager-bundle.

leofeyer avatar leofeyer commented on June 9, 2024

That's interesting. Which commands exactly did you run? You should compare

  • cache:clear

to

  • cache:clear --no-warmup
  • cache:warmup

from manager-bundle.

fritzmg avatar fritzmg commented on June 9, 2024

I've tested the following way:

rm -rf var/cache/prod
vendor/bin/contao-console cache:clear

and

rm -rf var/cache/prod
vendor/bin/contao-console cache:warmup

I did this before each request to ensure consistency. I did it 5 times for each case and took the average response time.

Note: I have used rm -rf var/cache/prod to ensure that the cache is cleared properly (since at least under Windows errors can happen during cache:clear due to file or operating system shenanigans). cache:clear --no-warmup should be equal to rm -rf var/cache/prod.

from manager-bundle.

leofeyer avatar leofeyer commented on June 9, 2024

What is the content of the contao/ folder in each case?

from manager-bundle.

fritzmg avatar fritzmg commented on June 9, 2024

The content of var/cache/prod/contao is identical in each case.

Btw., when using cache:clear, the pools folder will be generated on the first request. However, it will have much less content than with cache:warmup.

The twig folder is generated with the first back end request (since the back end uses twig templates in Contao 4.5).

annotations.php and bundles.map will also be generated on the first request.

from manager-bundle.

leofeyer avatar leofeyer commented on June 9, 2024

Hm, that does not make much sense, does it? Both cache:clear and cache:warmup will warm up the cache and they should not produce different results IMHO. Maybe a Symfony bug?

from manager-bundle.

fritzmg avatar fritzmg commented on June 9, 2024

Can you reproduce it? May be it only occurs on Windows? I'll also try on a Linux machine.

from manager-bundle.

fritzmg avatar fritzmg commented on June 9, 2024

I was actually unable to reproduce this on a Linux based shared hosting environment...

from manager-bundle.

leofeyer avatar leofeyer commented on June 9, 2024

Yes I can reproduce it. But both cache:clear and cache:warmup execute the same warmers, so I really don't understand it.

string(67) "Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer"
string(66) "Symfony\Bundle\FrameworkBundle\CacheWarmer\TranslationsCacheWarmer"
string(60) "Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer"
string(65) "Symfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer"
string(62) "Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer"
string(57) "Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheWarmer"
string(41) "Contao\CoreBundle\Cache\ContaoCacheWarmer"

from manager-bundle.

leofeyer avatar leofeyer commented on June 9, 2024

Anyway, we should probably just re-add the cache:warmup.

from manager-bundle.

fritzmg avatar fritzmg commented on June 9, 2024

And --no-warmup to be safe?

from manager-bundle.

leofeyer avatar leofeyer commented on June 9, 2024

Fixed in 77c85e2.

from manager-bundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.