Closed sourabhCofoundry closed 1 year ago
As far as I can see there's nothing in particular in the code you pasted that looks wrong from a performance point of view, it's basically two queries, one is pages to 6 items, and the other (images) should be cached in subsequent fetches (assuming latest version, default config etc).
Having said that, DateTime tempDate = customEntity.Date;
is weird because CustomEntityRenderSummary
doesn't have a date property, so it looks like you may have modified Cofoundry in some way, which I wouldn't be able to help you with. Also you say "6-6" posts at once? If you are running this code multiple times in every request than yes that might start to add up.
Aside from that, there could be plenty of issues outside of this code that I won't know about, e.g. is your db in the same location as your app? Is your db up to spec? What is the load? Have you isolated this code as the bottleneck/is anything else running in the request pipeline? In another issue you mentioned TTI, but TTI isn't just about the initial server response time etc etc
Hello, @HeyJoel HeyJoel I have faced a issue regarding a late server response. I have 102 blog posts with details. I am showing 6-6 posts at once but the server response is taking a long time to fetch data. This is code using Cofoundry.Core; using Cofoundry.Domain; using Cofoundry.Web; using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks;
namespace CMS { public class PostListViewComponent : ViewComponent { [Obsolete] private readonly ICustomEntityRepository _customEntityRepository; [Obsolete] private readonly IImageAssetRepository _imageAssetRepository; private readonly IPageResponseDataCache _pageRenderDataCache; private readonly IVisualEditorStateService _visualEditorStateService;
}