Feature/61 make plugin compatible with page caching

@mturalenka please review and merge

And most importantly: how can I verify this is working properly?