We are making broker query to fetch some forms data which are not user specific. There are total around 1000 forms and for different users the result is different based on the Query Criteria.
Following is the code sample(broker query part):
ComponentFactory cpf = new ComponentFactory();
Query query = new Query();
ItemTypeCriteria componentsOnly = new ItemTypeCriteria(ItemType.Component.GetHashCode());
SchemaTitleCriteria basedOnSchema = new SchemaTitleCriteria("Schema Name");
PublicationCriteria basedOnPublication = new PublicationCriteria(pubId);
Criteria Criteria = CriteriaFactory.And(new Criteria[] { componentsOnly, basedOnSchema, basedOnPublication });
query.Criteria = Criteria;
SortParameter sortParameter = new SortParameter(
SortParameter.ItemLastPublishedDate,
SortParameter.Descending);
query.AddSorting(sortParameter);
//Execute the query
var results = query.ExecuteQuery().ToList();
We have placed caching in Application Level (IIS) and also in code from the second time onwards. But for the first time it is taking too much time as along with Tridion Broker call we make some other service calls asynchronously, but we found out only for the broker call it is taking maximum time (20-22 secs) , which makes the page load complete after 30 secs around.
Please let me know if we can place any other caching at any level / modules to avoid such conditions. We are thinking to load all the forms at application start (MVC application) but again it will delay the login process. Please suggest.