caching - Varnish: purge cache every time user hits "like" button -


i need implement like/dislike functionality (for anonymous users there no need sign up). problem content served varnish , need display actual number of likes.

i'm wondering how it's done on website stackoverflow. assuming pages cached in varnish (for anonymous users only), every time user votes on answer/question, page needs purged cache. right? current number of votes needs visible other users.

what approach in situation? should send purge varnish every time user hits "like" button?

a common way of implementing button , display client side in javascript instead. avoids issue slightly.

assuming pressing leads post request hitting single varnish server, can make object invalidated/replaced in different ways. using purge , vcl restart better way this.

of course there slight race here, other clients served old page while ongoing.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -