I'm just going to go with Twig's cache naming mechanism for now. It seems to always work correctly and it may be tricky to do it without causing issues. We can address the cache file naming scheme later if we want (it isn't very friendly).