Disable query caching to accent query-related optimizations
Shorten the messages controller by one line
Mark multiple messages as read in one query

…rather than in 2n queries, where n is the number of messages being
marked as read.
Add database indexes to queried and ordered message columns
Eager-load the sender for each message in the list view

This consolidates the per-message queries into one query to load each
message's sender into memory.
Fragment cache individual message table rows

View rendering can take much more time than you might expect.
Short-circuiting the process by pulling pre-rendered text out of memory
can significantly reduce rendering time.
Specify the inverse association for a user's received messages

This avoids extra lookups per message in the list view to display the
name of the recipient, since we already have the recipient loaded into
memory.
Memoize the current_user method

…so that it's not evaluated (performing a database query) multiple times
per request.