KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm developing a webgame. As part of the game, you start out with a limited set of features, and you unlock more of them as you play. For instance, you unlock /fields as part of step 3 in the tutorial. But what if you just navigate to /fields in the address bar? I'm trying to work out what would be the best status code to respond with. 403 seems ideal since the user is forbidden from accessing the page until they unlock it. 404 also makes sense since the page technically "doesn't exist" until it is unlocked and also prevents users from being able to tell the difference between a page that doesn't exist and one that they just haven't unlocked yet. But in both cases I've had some users report issues with the browser cacheing the 403/404 result and not letting them access the page even after unlocking it unless they purge the cache entirely. I'm wondering if I should keep using 403 or 404, or should I use an unused 4XX code such as 442 with a custom statusText, or even jokingly send HTTP/1.1 418 I'm A Teapot in response to a user poking around where they shouldn't be. I need a good, solid reason why one option should be used over the others.
Tags (comma-separated)
Save Edits
Cancel