Best practices in development?

I have the impression that during development - despite disabled cache - changes in Concrete only take effect with a delay.
Of course, this could also be due to the server, but I wonder whether I have taken an unfavourable path.

I currently access the server via an SSH plugin in MS Visual Code and write a package or a theme, for example. What do you do after a change? Do you uninstall the package or theme via the dashboard and then reinstall it?

What is your approach? Is there a “best practice”?

Best!

I have the impression that during development - despite disabled cache - changes in Concrete only take effect with a delay.
Of course, this could also be due to the server, but I wonder whether I have taken an unfavourable path.

This doesn’t sound right to me - with caching off, any coding change you make should be reflected immediately.

Where things might trip you up:

  • Opcache if enabled can sometimes not pick up PHP changes
  • CSS or other resources can be cached in your browser, due to typical server side caching headers

My recommendation would be to try to set up a local development environment, one where you don’t have to constantly push files up to a server to test and preview. You can then adjust that however you see fit, turning off any caching headers. It’s just faster to develop with too.

If you are working on a live server, you can find in Chrome’s Developer console, under the Network tab, a ‘Disable Cache’ option. This tells the browser to ignore all caching instructions, and to always download resources fresh. This can be handy if you’re trying to work out if something like a CSS change has been applied or not.

If you’re just talking PHP changes, there should never be a need to uninstall and reinstall packages and themes, just for changes to appear.

The exception is if your add-on has custom database tables, or custom block tables, or does a bunch of custom set up when installing (like adding attributes). In these cases you’d need to trigger the refresh/upgrade of your blocks or add-on.

1 Like

Oh my gosh @mesuva! Many, many thanks for your detailed answer! I appreciate it very much! I can also relate to all your suggestions - most likely the Opcache will be the culprit for my problem. I will switch it off and monitor the situation.

Part of my workflow is to always have the Web Inspector open and the cache disabled.

In any case, many thanks for the tips! This gives me much more confidence when developing!