Added file locking support to caching