Performance: API versioning
MEDIUM IMPACT
API versioning affects server response time and client load speed by managing how API changes are delivered and cached.
module Api
module V1
class ItemsController < ApplicationController
def index
render json: { data: 'v1 data' }
end
end
end
module V2
class ItemsController < ApplicationController
def index
render json: { data: 'v2 optimized data' }
end
end
end
endclass ApiController < ApplicationController def index # No versioning, all clients get the same response render json: { data: 'all data' } end end
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No API versioning | N/A | N/A | Large payload slows client rendering | [X] Bad |
| Versioned API endpoints | N/A | N/A | Smaller payloads improve client rendering | [OK] Good |