What script is responsible for creating cache/modules/* files

I have a file in my cache directory
cache/modules/Notifications/Notificationsvardefs.php

that is being recreated/updated during the save of an account record.  Unfortunatly when it is updated the 

'custom_fields' => true,

is being left out leading to a 500 error when it tries to run queries with the custom fields.

I have NO idea why it would be updating a cache file during a save but there is no doubt that it is.

Does anyone know where in the code these files are updated/created so I can trace this down?

Thanks