First,let’s make a client-side RSS wid get.RSS will benefit from client-side caching because not all RSS feeds change frequently, e.g.,you can safely cache a feed for an hour. Also, popular RSS feeds are subscribed by many users,so caching a popular feed on the server and serving it to hundreds of thousands users will save the server from fetching the same feed again and again from the source.
Some fundamental differences in a client-side RSS widget include:
• It does not load the RSS feed from the server-side code. So, there’s no LINQ to XML code in the widget’s code that downloads the RSS XML. The LINQ to XML code is now inside the proxy service.
FastRssWidget.ascx now contains almost no UI elements
On the widget server-side code, the Page_Load event registers a script include tag for the Fast Rss Wid get.js(see Example).
The Page_Load event of FastRssWidget control adds a script tag to download FastRssWidget.js and then initializes the class to show the feeds on the client
The Page_Load event of FastRssWidget control adds a script tag to download FastRssWidget.js and then initializes the class to show the feeds on the client (continued)
During On Pre Render a script block is sent to refresh UI on the client
That’s all on the server.However,the client-side class is a bit more complicated as we move most of the code to the client from the server.The class is available in the Feed Rss Wid get.js file.
The client-side FeedRssWidget class
The constructor takes the parameters like the URL, container ID, and number of feed links to show.Then the load function calls the Proxy.GetRss function to get the feed.It passes the URL,the number of feed items to return, and the cache duration in minutes.The response is cached for 10 minutes, so loading the page again or returning to the page from another web site within 10 minutes will deliver the response directly from the browser cache without making any call to the proxy web service (see Example ).
Proxy.GetRss fires the onContentLoad function as callback and it renders the feed links
Proxy.GetRss fires the onContentLoad function as callback and it renders the feedlinks(continued)
On the on Content Load function, it creates the hyperlinks for the feed items on the client side.There are some benefits to this client-side widget over the server-side widget:
• No ViewState is delivered because there’s minimal UI on the web control, so first load and asynchronous postback have very little payload
• Content is cached on the browser and saves roundtrips to the network
• Content is fetched via the proxy instead of asynchronous postback, so it benefits from server-side caching.
ASP.NET Related Interview Questions
|VB.NET Interview Questions||C#. NET Interview Questions|
|ASP.NET Interview Questions||ADO.Net Interview Questions|
|Windows Presentation Foundation(WPF) Interview Questions||Windows CE .NET Interview Questions|
|Dot Net Framework Interview Questions||Asp Dot Net Mvc 4 Interview Questions|
|Asp Dot Net Mvc Interview Questions|
Introducing Web Portals And Dropthings.com
Architecting The Web Portal And Widgets
Building The Web Layer Using Asp.net Ajax
Building The Data And Business Layers Using .net 3.5
Building Client-side Widgets
Optimizing Asp.net Ajax
Creating Asynchronous, Transactional, Cache-friendly Web Services
Improving Server-side Performance And Scalability
Improving Client-side Performance
Solving Common Deployment, Hosting, And Production Challenges
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.