Add indexes and pagination to improve app performance

This commit is contained in:
Peter Stockings
2026-03-09 21:29:16 +11:00
parent acad2def92
commit 7b36a6795d
8 changed files with 264 additions and 208 deletions

View File

@@ -67,7 +67,9 @@ def profile_image(user_id):
response.headers.set('Content-Type', 'image/jpeg')
response.headers.set('Cache-Control', 'public, max-age=86400') # Cache for 1 day
response.headers.set('ETag', str(hash(profile.profile_pic))) # Unique ETag for the image
response.headers.set('Last-Modified', http_date(datetime.utcnow().timestamp()))
# Use actual profile update time instead of utcnow() which defeats caching
last_modified = profile.updated_at or datetime.utcnow()
response.headers.set('Last-Modified', http_date(last_modified.timestamp()))
return response
else: