As of 3.1.7 we've got a nice new
Flushable interface (thanks Sean Harvey!) but I think it's still hard to know exactly what happens when you add ?flush=1 to your URL, and it's importance in the development workflow is way underemphasised.
Here's all the documentation I could find on the subject:
I think it's unclear for existing developers how flushing is different now than it was before (not that it was clear before), and it's probably unclear to new developers just how important Flushing is.
Think there needs to be something more like this in the Docs (please correct me if I've misunderstood or missed anything):
To optimise performance SilverStripe caches data whenever it can. As you build your site the various caches can become out of date and you will occasionally need to clear them. This is called 'flushing' and you do this by adding ?flush=1 to any URL on your site. It's especially important to perform a flush every time you add new PHP classes and templates so that SilverStripe is made aware of their existence.
These are some of the things that happen when you perform a flush:
- The class manifest is rebuilt (new PHP classes are discovered)
- All .ss templates are recompiled, and new templates are discovered
- All cached combined files (e.g. CSS/JS) are deleted and rebuilt
- All cached partial cache blocks are deleted (they will be regenerated on a subsequent request)
- Cached/resampled images are regenerated for the current request (e.g. just the images on the page you're viewing)
In addition to updating the Docs I think it's important for people learning SilverStripe development that it be possible to perform a flush directly from the /dev/ menu. Ideally dev/build would automatically perform a flush, but I assume there's a practical reason for not including this functionality*. In that case I think an additional menu item 'dev/flush' would make sense. This would make this function easily accessible and highlight it as a critical step during development.
*Is there a practical reason for not including this functionality?