Comments (14)
Yes. Basically the code from Contao 4.4.
manager-bundle/src/Composer/ScriptHandler.php
Lines 37 to 38 in df75e03
from manager-bundle.
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.
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.
That's interesting. Which commands exactly did you run? You should compare
cache:clear
to
cache:clear --no-warmup
cache:warmup
from manager-bundle.
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.
What is the content of the contao/
folder in each case?
from manager-bundle.
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.
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.
Can you reproduce it? May be it only occurs on Windows? I'll also try on a Linux machine.
from manager-bundle.
I was actually unable to reproduce this on a Linux based shared hosting environment...
from manager-bundle.
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.
Anyway, we should probably just re-add the cache:warmup
.
from manager-bundle.
And --no-warmup
to be safe?
from manager-bundle.
Fixed in 77c85e2.
from manager-bundle.
Related Issues (20)
- Increase Process timeout or make it configurable HOT 4
- PHP error on first run in Plugin.php HOT 1
- robots.txt fehlt HOT 12
- open_basedir restriction in effect HOT 12
- Installation of legacy modules under symfony 3.4.7 fails HOT 21
- Allow to disable HttpCache HOT 2
- Allow to set trusted proxy settings using an env variable HOT 1
- Contao 4.4.17 & Symfony 3.4.8 error: "A Token was not found in the TokenStorage" HOT 1
- Prs6HttpCacheStore breaks Contao HOT 1
- If the .htaccess already exist contao is not placing its own HOT 11
- SQL to create tl_layout table fails on MariaDB 10.2.16 HOT 11
- Preview maintenance mode locally HOT 2
- Docu HOT 2
- Run composer scripts HOT 6
- Symfony 5 is required for Monolog 2 support. HOT 2
- .env files are ignored when using the symfony binary HOT 7
- Array to string conversion HOT 3
- Problem using PHP 7.4 - FOS/http-cache-bundle issue HOT 4
- Where is the config/ directory in fresh 4.12 installation ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manager-bundle.