Improved caching - cached files include dirname