I use Cache file:
- Homepage Products
- Homepage Best Sellers
- Category Navigation
- Homepage Categories
- Manufacturer Navigation
I see improved page load speed. Who got the idea to develop cache file and memory.
For example
1. /Views/Catalog/HomepageProducts.cshtml
@if (Model.AllowCacheHomepageProducts)
{
<div id="HomepageProducts">
</div>
<script type="text/javascript">
$.get('/Cache/Catalog/HomepageProducts.htm', function (data) {
$('#HomepageProducts').html(data);
});
</script>
}
else
{
......
}
2. /Models/HomePageProductsModel.cs
public partial class HomePageProductsModel : BaseNopModel
{
public HomePageProductsModel()
{
Products = new List<ProductOverviewModel>();
}
public bool UseSmallProductBox { get; set; }
public bool AllowCacheHomepageProducts { get; set; }
public IList<ProductOverviewModel> Products { get; set; }
}
3. /Controllers/CatalogController.cs
[ChildActionOnly]
public ActionResult HomepageProducts(int? productThumbPictureSize)
{
var model = new HomePageProductsModel()
{
UseSmallProductBox = _catalogSettings.UseSmallProductBoxOnHomePage,
AllowCacheHomepageProducts = _catalogSettings.AllowCacheHomepageProducts
};
....
}
demo: http://test265.rstyle.vn/