Invalidate cache for watched files

As discussed in #266