I just finished the book and overall it was really good. Covers an area that is usually glossed over by other books.
I was concerned, however, after reading the chapter on Performance, specifically caching. In this section, there were some very broad statements made that aren’t entirely accurate.
Such as “You can use page caching as long as you don’t need authentication”. This isn’t true if you have any user specific information on the page, including things like the authenticity token. If you do have this, then there are techniques for pulling those in asynchronously once the cached html page is rendered.
The other part I found to be dangerous advice was the part about action caching. “If you need authentication, then use action caching” - The code example proceeds to cache the action with the current user’s creations.
class CreationsController < ApplicationController before_filter :authenticate_user! caches_action :index def index @creations = current_user.creations end end
If this isn’t nested in some sort of route based on the user id, then the result is the current user’s cached creations are served to everyone. Am I wrong in this?
I’d suggest making some tweaks to this section for the next edition, or remove it entirely. It’s the glossing over that other books usually leave to the view that this book is doing to caching.
That said, I’m very happy with my purchase and I will be referring to this book often.
Thanks for writing it!