Tutorial

HOW TO CLEAR MAUTIC CACHE IN PODMAN

I had a challenge with my mautic landing pages when I did a fresh install using Podman. Part of the process that I thought was both useful and educational and worth leaving as a permanent post was how to clear the Mautic cache, especially using podman

This mautic documentation page indicated that it may be required to

a) clear the cache directory and
b) clear the browser cache

I knew how to clear a browsers cache, but I realized that although I was comfortable in the command line this instruction was still a bit new to me:
“Now you need to clear your Mautic cache located in var/cache and refresh the Landing Page before you can work with the new GrapesJS Builder.”

Their page gives a good explanation for the usual installation method (ie. LAMP) but I was still new to Podman so this was much harder to me.

CLEARING MAUTIC CACHE USING PODMAN

Here is what I did:

  1. get CLI command prompt of specific mautic container with: podman exec -it <container-name> bash. This brings me to the ‘docroot’ directory of install which looks like this root@<container-name>:/var/www/html/docroot#
  2. Confirm that there is actually a cache and that it’s where it should be with this: ls -al /var/cache/ You should see a few things and at least not get any errors.
  3. To remove everything in the /var/cache/ directory with this (and be careful – it’s final): rm -rf /var/cache/*
  4. Confirm whatever you saw before is no longer there with: ls -al /var/cache/
  5. See if whatever was broken is now working by refreshing your Mautic page.

I also found this way to do it, which might be ‘more correct’ and probably safer, but I’m not smart enough to currently know. But this also worked to clear some Mautic cache using podman:

  1. Log into the container (same way as above)
  2. Run this PHP command: php /var/www/html/bin/console cache:clear
  3. See if whatever was broken is now working by refreshing your Mautic page.

Hope this helps!

Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *