Rails 4.1 Performance Fundamentals
Speed up your Ruby on Rails 4.1 (and 4.0 and 3.2) applications. This course covers profiling techniques; making fewer, faster, database queries; Russian Doll caching; Turbolinks and more.
What you'll learn
Speed up your Ruby on Rails 4.1 applications. With the help of some gems, all techniques in this course can also be used in Rails 3.2 apps. This course teaches pragmatic, Rails-specific techniques to profile performance, find and fix slow database queries, get alerted automatically whenever you create an N+1 query, and simulate latency and low bandwidth. You'll also learn to take advantage of the browser's cache with ETags or time-based expiration, set up Memcached for server-side caching, speed up view rendering with fragment caching, cache nested fragments with Russian Doll caching, and use Turbolinks and pjax to give a multi-page app the responsiveness of a single-page app.
Table of contents
- Introduction 2m
- Profiling, X-Runtime, and the Browser's Network Debug Panel 5m
- The Rails Log 4m
- Pagination and Kaminari 4m
- Missing Indexes and Lol_dba 7m
- Bullet, N+1 Queries, and Counter Caches 11m
- Rack-Mini-Profiler and Flamegraphs 8m
- Select and Pluck 3m
- The Query Cache 2m
- New Relic and Rails Panel 5m
- Do Not Order By :created_at 2m
- Making Multiple Writes? Use a Transaction 1m
- Iterating Over Tons of Rows? Use find_each 3m
- Summary 7m
- Introduction and HTTP Headers 2m
- Last-Modified and If-Modified-Since 2m
- ETag and If-None-Match 2m
- Cache-Control and Max-age 2m
- Rack::ETag and Rack::ConditionalGet 3m
- stale? and fresh_when? 10m
- Declarative ETags and the ETagger Gem 6m
- Setting Cache-Control: max-age With expires_in 1m
- Disable Middleware that Modifies the Body 4m
- Demo 12m
- Summary 3m
- Introduction and Cache Stores 4m
- Setting Up Memcached in Rails and for Development 3m
- Fragment Caching 2m
- Fragment Caching With Array as Cache Key 2m
- Fragment Caching a Paginated List 3m
- Hash as a Fragment Cache Key 2m
- Cache Expiration Strategies, From Best to Worst 4m
- Cache Key Includes a Digest of View Contents 2m
- Demo: Fragment Caching the Index Pages 7m
- Demo: Fragment Caching the Show Pages 3m
- Benchmark Results From Fragment Caching 3m
- Summary 3m
- Introduction and the Responsiveness Myth 2m
- Installing Turbolinks 5m
- How Turbolinks Works 3m
- Third Party Plugin Compatibility and jQuery Turbolinks 4m
- Bind $(document) Events Outside 'ready' 3m
- All Scripts in 'body' are Evaluated 1m
- Opt Out for Selected Links 1m
- Testing Turbolinks 1m
- Demo: Benchmarking Turbolinks 4m
- Transition Cache 4m
- pjax 3m
- Summary 3m