HI everyone,
I have managed to create on SP2010 an beautiful MegaMenu suing Bootstrap + JQuery following the article of Teylyn implemented into Masterpage. Â
We have more than 250 Web Servers around the world (Not Only Sharepoint), and I would like to provide, as an HTML Include, this megamenu to all of the websites.
Can you suggest me how to generate this HTML from what I have already.
The concept of the Teylyn megamenu is using DVWP with a Datasource and XSL format.
I don’t want to have a dynamic generation, but and HTML file generated, when there is a change into onoe of the 2 Header and content list or by hitting an ASPX page which will produce this HTML output. Another idea was to have a Web Service to generate this with a cache to be recycle only when lists changes.
All idea are welcome.
The simple answer for performance is yes cache this.
Perhaps the best way to cache it in 2010 is by using a cacheable iHttpHandler, which expires every x days that supplies the html to be injected. The ashx (iHttpHandler) will contain a static object that only refreshes itself every 2 hours. This will prevent it being loaded on every request, then further cached using browser cache in an ajax call.
This can be loaded async from the server using an ajax call, which caches client side and in turn is injected into the dom after page load.
The pattern would be:
Server side ashx -> serves the html, marked as cacheable with an appropriate timeout
Client Side ajax call -> gets the html after page load
On result of the call, the hidden menu content is injected with the html from the ashx
The 3 components for speed here are:
1) Static object that only reloads the server list once per hour, or day to prevent it being read from possibly thousands of times while people load their local cache.
2) The browser cache prevents the http request when not needed
3) The ajax call is async, so it will update the pages html without impeeding page performance, or perceived load times of the end user.
Hope that helps.