- Use `default=str` in `json.dumps` to handle non-serializable objects - Return proper HTTP 304 response with ETag header instead of raising exception - Ensure consistent ETag generation for template caching