What do y think about cache?
Why you don't use cache(aspx and other)
Do you have samples of cache?
or maybe which kind of cache recommended to use(i saw in cms only DAL cache)?
Maybe there are some bestpractice to use cache?
if (ctrlBestSellers != null) //I add this condition because when control is in cache, his reference is null
{
ctrlBestSellers.Visible = SettingManager.GetSettingValueBoolean("Display.ShowBestsellersOnMainPage");
}
BindJQuery();
string superFishMenu = CommonHelper.GetStoreLocation() + "Scripts/jquery.superfishmenu.js";
Page.ClientScript.RegisterClientScriptInclude(superFishMenu, superFishMenu);
Page.ClientScript.RegisterClientScriptBlock(GetType(), String.Format("{0}_sfmenu", ClientID), String.Format("$(document).ready(function(){{$('#{0}').superfish({{autoArrows:false,speed:'fast',delay:200}});}});", ClientID), true);
BindJQuery();
string superFishMenu = CommonHelper.GetStoreLocation() + "Scripts/jquery.superfishmenu.js";
Page.ClientScript.RegisterClientScriptInclude(superFishMenu, superFishMenu);
Page.ClientScript.RegisterClientScriptBlock(GetType(), String.Format("{0}_sfmenu", ClientID), String.Format("$(document).ready(function(){{$('#{0}').superfish({{autoArrows:false,speed:'fast',delay:200}});}});", ClientID), true);
<%@ OutputCache Duration="300" VaryByParam="ProductId" %>
<%@ OutputCache Duration="300" VaryByParam="CategoryId" %>
public override string GetVaryByCustomString(HttpContext context, string custom)
{
string strKey = string.Empty;
if (custom.ToLower().Contains("language"))
{
strKey += "-" + NopContext.Current.WorkingLanguage.LanguageId.ToString();
}
if (custom.ToLower().Contains("[...]"))
{
[...]
}
return strKey;
}