Search code examples
ruby-on-railsrubynet-http

Do Net:HTTP calls/results in Rails get cached?


If I load a section of my website with Net::HTTP in Rails, will this get loaded every time or will it get cached along with the rest of the footer?

EDIT: I mean the rest of the footer is currently cached. Would the Net:HTTP results, which get rendered inside the footer, also become cached? I would like it to reload the results every time.


Solution

  • No, Net::HTTP will not cache anything for you. You will have to implement caching, or use a gem that does it for you. But depending on what you do with Rails, Rails can do it - look into fragment caching.