Bug/251 invalidate cache when republishing

Fixes #251