C
C#2y ago
Dreams

❔ API Call really slow (6+ seconds) on first call, then fast (100ms) afterwards

Frizerski Salon ML
Frizerski Salon ML is ... TODO
GitHub
Frizerski-Salon-ML/DynamicContentController.cs at main · dzenis-zig...
Contribute to dzenis-zigo/Frizerski-Salon-ML development by creating an account on GitHub.
6 Replies
ACiDCA7
ACiDCA72y ago
without looking it up, i asume you are using entity framework. EF is doing magic on first call, which takes some time.
Dreams
DreamsOP2y ago
[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);
}
[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
ACiDCA72y ago
Stack Overflow
How to "warm-up" Entity Framework? When does it get "cold"?
No, the answer to my second question is not the winter. Preface: I've been doing a lot of research on Entity Framework recently and something that keeps bothering me is its performance when the q...
Dreams
DreamsOP2y ago
the issue was happening every 15-30 mins but i think it's because Azure App was doing funny stuff
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server