0

I'm trying to cache a ascx control in .NET because it's slowing down the website - it works for a few seconds well up to a minute but after that it breaks the main menu of the website and squashes it together.

<%--<%@ OutputCache Duration="86400" VaryByControl="none" VaryByParam="*" %>--%>

I'm not able to post the code that outputs the main menu due to it being in house coding.

Is there any other way i can do output caching that doesn't break the main menu?

See screenshot to what happens once output caching is applied; HERE

Apologies if i've been too vague.

Right i've tried it this way doesnt seem to screw the main menu up but when you load the page up it gets put in to the cache but when you click on other page it's still slightly slow in loading up.

protected void Page_Load(object sender, EventArgs e)
{
    Response.Cache.SetExpires(DateTime.Now.AddMonths(1));
    Response.Cache.SetCacheability(HttpCacheability.ServerAndPrivate);
    Response.Cache.SetValidUntilExpires(true);
}

You can have a look at the site here: WEBSITE LINK HERE

Is there anything else i can do to quicken to loading time before it gets put in to the cache?

mjcoder
  • 1,009
  • 9
  • 25
  • 45
  • " breaks the main menu of the website ". Please explain how caching affects this functionality. Any code you can show us, that will be good. – R.C Sep 11 '13 at 08:29
  • @FlopScientist if you have a look at the screenshot here: http://imgur.com/w5YfvcG – mjcoder Sep 11 '13 at 08:46

0 Answers0