http - How to deal with number of pageviews in RESTful calls? -
i'd have request returning "analytics" part of request: importantly, i'd every requests return number of times request has been called.
is fundamentally incompatible restful concept?
if it's not fundamentally incompatible, how can have restful server return different result each request seen that, definition of problem, every requests means next request must return different?
if it's fundamentally impossible in restful way, should drop rest or drop altogether?
p.s: first question on so apparently won't able comment unless hit 15 rep nice if commenters/answerers upvote me can part of community : )
there no incompatibility rest in principle here. should consider effect constantly-changing resource not benefit caching (assuming don't want visit count go stale). should consider number "eventually consistent"; is, represent count subset of requests if have lots executing in parallel. , should consider returning count in "x-visit-count" header instead of main payload make feature more generic , avoid polluting whatever payload return, , potentially allow better caching. there's nothing @ "against rest" resource return different representation each time it.
Comments
Post a Comment