Performance: HTTP methods (GET, POST, PUT, DELETE)
MEDIUM IMPACT
This affects how fast the server responds and how much data is sent or received, impacting page load and interaction speed.
from flask import Flask, request app = Flask(__name__) @app.route('/update', methods=['PUT']) def update(): data = request.get_json() # process update return 'Updated', 200
from flask import Flask, request app = Flask(__name__) @app.route('/update', methods=['GET']) def update(): data = request.args.get('data') # process update return 'Updated', 200
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| GET for fetching data | Minimal | 0 | Low | [OK] Good |
| POST for fetching data | Minimal | 0 | Low | [X] Bad |
| PUT for updating data | Minimal | 0 | Low | [OK] Good |
| GET for updating data | Minimal | 0 | Low | [X] Bad |
| DELETE for deleting data | Minimal | 0 | Low | [OK] Good |
| GET for deleting data | Minimal | 0 | Low | [X] Bad |