My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How should caching be handled in a RESTful API?

Noah's photo
Noah
·Aug 3, 2016

Most tutorials and articles I've read about REST only touch on the subject, and the few that elaborate basically recommend adding a "last modified" column to my database table that the API can check. However, is that really the best way to go about it? I don't like the idea of adding columns to my database purely for the sake of the client - that seems to go against REST's goal of a client-server relationship where neither entity has to know the needs of the other.

Is there a better way?