3 ms·
I was just wondering if a web page that counts visitors is idempotent. Not?
by xunn0026 5y ago
I was just wondering if a web page that counts visitors is idempotent. Not?
- Filligree 5y agoIt changes state on the server, i.e. the counter. So no.
- mananaysiempre 5y agoI’d say it depends on what the counter is for. If it’s used to bill the user per pageview, then it’s user-visibly not an idempotent action, so no. If it’s used to estimate site speed, then the user doesn’t care, so yes. (In fact, analytics is the example I see most often under “non-idempotent stuff it’s OK to do on a GET”.) If it’s used to display a counter in the site footer, then you might wish the user cared for your bragging, but they probably don’t, so yes with a disapproving glance in your general direction.