Caching data in Ruby on Rails using Mongoid

Hey.

I’ve made a webcrawler using Ruby on Rails API and MongoDB/Mongoid that returns a JSON. Is there that I can use some Mongo module for caching the data returned as JSON? How to implement it?

Hi @Victor_Lacerda,

The Mongoid Query Cache may provide the functionality you’re looking for. When enabled, the query cache saves the results of previously executed find and aggregation queries and reuses them in the future instead of performing the queries again, thus increasing application performance and reducing database load.

1 Like