contao / contao-manager

Contao Manager
GNU Lesser General Public License v3.0
85 stars 33 forks source link

Delete cache folder in “Clear Production Cache” after cache:clear #655

Closed ausi closed 2 years ago

ausi commented 3 years ago

Currently the “Clear Production Cache” action executes the following command:

  1. rm -rf var/cache/prod
  2. contao-console cache:clear --no-warmup

Afterwards the container cache exists in var/cache/prod which can cause issues if the PHP environment of the manager is not exactly the same. I would suggest to add another rm -rf var/cache/prod as a third step.

See https://github.com/contao/contao/issues/3305#issuecomment-899730840

aschempp commented 3 years ago

How is this supposed to work if you actually warm the cache (which is what you should always do)?

ausi commented 3 years ago

How is this supposed to work if you actually warm the cache

If you warm the cache, var/cache/prod should exist and therefore the additional rm is not needed there IMO.

I think it would be great for debug purposes if “Clear Production Cache” actually clears the cache completely, as you can see in the linked issue.

fritzmg commented 3 years ago

Clearing without warmup is "dangerous" anyway, if you don't know what you are doing. If you do not do a warmup and then do a request in the front end, the internal cache of Contao will be missing. I think the Contao Manager should not offer a clear only option.

aschempp commented 3 years ago

it is not dangerous, it's "only" less performant.

fritzmg commented 3 years ago

Yes, but no one knows that.

leofeyer commented 2 years ago

As discussed in Mumble on September 30th, we want to add a third step rm -rf var/cache/prod to completely remove the cache folder.