4 ms·
This is a great guide but it's not complete. One of the biggest problems with all of these guides is that they focus solely on view caching. As far as I can te
by driverdan 11y ago
This is a great guide but it's not complete. One of the biggest problems with all of these guides is that they focus solely on view caching.
As far as I can tell the Rails ecosystem completely lacks a good model / data caching system. There are a few gems that do model caching but they all have major flaws. I'd love to see a good guide on Rails data caching and gems that eliminate the mess of calls to Rails.cache.fetch.
- mperham 11y agoThis is because caching should be done as coarsely as possible. Caching views and entire pages is the common case.
- sethherr 11y agoExactly - why did page caching get removed from rails core?
- halostatue 11y agoSo what’s the best approach for caching API responses?
- karmajunkie 11y agoAn api response isn't any different from a web page insofar as infrastructure is concerned. HTTP caching is usually my first choice when I have the wherewithal to do that. [Edit: conditional responses are probably the best way to go – save the bandwidth.]