Middleware for handling ETag requests