I have a Restful service. A GET service. I find that the first time this service is called it takes roughly 3000mSecs. However, subsequent retries it returns in 400mSecs.
The GET call may or may not be fetching/returning the same data from a db. And the database has 20-30 rows. So I dont imagine it to impact time taken to fetch. Data returned by the service is never cached in the code. So, each time, when a call is made, data is fetched from the db and returned.
And after a few hours the Rest service again takes 3000mSecs and immediate next calls return much quicker. The service runs from an entity core webapp build using ASP MVC .net C# over IIS on a remote AWS cloud
Any thoughts on why the delays first time ? and how it can be reduced or avoided ? Some pointers would help please