C#
C#

help

Root Question Message

Zigo
Zigo12/16/2022
API Call really slow (6+ seconds) on first call, then fast (100ms) afterwards

Website (may or may not be slow): https://delightful-hill-04904a303.2.azurestaticapps.net/

The method GetList() at line 138 is the API call: https://github.com/dzenis-zigo/Frizerski-Salon-ML/blob/main/SalonML/SalonML_API/Controllers/DynamicContentController.cs
ACiDCA7
ACiDCA712/16/2022
without looking it up, i asume you are using entity framework. EF is doing magic on first call, which takes some time.
Zigo
Zigo12/16/2022
[HttpGet]
public async Task<IActionResult> GetList()
{
   // ** todo get this to order by OrderIndex **
   var dynContentList = _context.DynamicContents
      .OrderByDescending(x => x.OrderIndex)
      .Select(d => new DynamicContentDTO(d))
      .ToLookup(x => x.Name);

   return Ok(dynContentList);
}
ACiDCA7
ACiDCA712/16/2022
Zigo
Zigo12/16/2022
the issue was happening every 15-30 mins but i think it's because Azure App was doing funny stuff
Wetweezil
Wetweezil12/17/2022
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy