[Galaxy S 4 i9505 Android Development] Bejda:
Back to an old story then,sorry but if interested (and brave enough+aspirin at hand to get over my syntax) i had occasion and time to post the little,"little" on a knowledge point of view of course lol, i can tell about /cache and dalvik-cache..

http://xdaforums.com/showpost.php?p=54265787&postcount=4051

To, at least try to, put it shortly or more clearly:

_ No there's no wipe /cache or dalvik-cache command on standard aosp updater-scripts.

_ No wipe /cache nor dalvik-cache during flash in any way,you can flash any CM/aosp custom build and use Aroma File Manager to do the before&after flash check, /cache and dalvik-cache will still be populated after flash unless you did wipe it yourself.

_ There's no direct relation between /cache and dalvik-cache:

/cache is a dedicated partition (see post for more details).

Usual or commonly used location for dalvik-cache is under /data partition but jflte CM based builds use /cache/dalvik-cache location for system apps and .jar

If you wipe dalvik-cache under recovery it will wipe both /data/dalvik-cache and /cache/dalvik-cache if exists but not the whole /cache partition.

App's cache is something else and under our /data partition ( /data/data/*app's folder*/cache).

_ No, dalvik-cache is not under our /system partition.

I don't think such configuration ever exists on an Android device except maybe through some users tweaks on some old devices where you had to play with low user storage space.

_ What provokes a dalvik-cache rebuild: If it's not an user action or commanded through some (updater-)scripts it's Android itself.

_ When: Most probably when different versions of some or all /system/framework/***.jar files are installed and detected at boot.

Flash same rom build version and see if you get "Android upgrading optimizing apps process" at next boot..no. That makes another thing that also shows if needed that simply "flash a rom" doesn't mandatory induces a dalvik-cache rebuild.

_ I think specifically about /system/framework/***.jar files because if you push a new .jar file to your /system/framework/ you get "Android optimizing" at boot but not only for this .jar file like when we push a new system app and reboot (where at boot the newly installed system/app creates its own classes.dex file) it seems to rebuild all user's apps classes.dex files (classes.dex files which are the dalvik-cache content).

Seen the twframework.jar file example but it's the same with gapps,if you flash a minimal gapps pack which contains only about 15 new apps and framework .jar files (just to see better for our example) on a rom without gapps at this moment you'll have "Android upgrading" for this 15 new files+all your data/apps.

If it's a new/different rom build that you flash you have "Android upgrading" for the whole stuffs (all system apps and framework .jar files + data/apps).

Same story than with a rom: Flash exact same build>no dalvik-cache rebuild / Flash the same gapps pack twice on top > no dalvik-cache rebuild after second flash.

So (all is clear now isn't it?lol sorry again) for me Android handles dalvik-cache rebuild for us if needed and i guess i'll never understand that user's irrational need to wipe /cache partition especially with no idea of what's up there.