Describe a scenario where you had to optimize a slow-performing database query or API endpoint for an SPR client.