Performance: API-only application setup
MEDIUM IMPACT
This setup affects initial page load speed and server response time by minimizing unnecessary frontend assets and middleware.
rails new myapp --api
# API-only mode disables views, asset pipeline, and reduces middlewarerails new myapp # default full-stack setup with views, assets, and middleware # serves HTML views and includes asset pipeline
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full-stack Rails app serving HTML views | Many DOM nodes generated by views | Multiple reflows due to large DOM | High paint cost from complex UI | [X] Bad |
| Rails API-only app serving JSON | No DOM generated by server | No reflows triggered by server | No paint cost from server response | [OK] Good |