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

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -