Add indexes and pagination to improve app performance
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user