Web form caching based on GET and POST requests Part 123

  • دعنا نشارك هذا :
ترتيب الدرس : 123
المدة : 00:08:21
التحكم :
Text version of the video
http://csharp-video-tutorials.blogspot.com/2013/02/web-form-caching-based-on-get-and-post.html

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation1

Slides
http://csharp-video-tutorials.blogspot.com/2013/08/part-123-web-form-caching-based-on-get.html

All ASP .NET Text Articles
http://csharp-video-tutorials.blogspot.com/p/free-aspnet-video-tutorial.html

All ASP .NET Slides
http://csharp-video-tutorials.blogspot.com/p/aspnet-slides.html

All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenkat/playlists?view1&sortdd

All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatArabic/playlists

In this video, we will discuss about how webforms are cached based on GET and POST requests. One of my youtube subscribers asked this question, related to Part 120 - Caching mulitple responses for a single web form. Please watch Part 120, from the asp.net video tutorial before proceeding with this video. Link for asp.net tutorial :
http://www.youtube.com/playlist?listPL6n9fhu94yhXQS_p1i-HLIftB9Y7Vnxlo

We will be using the same example from Part 120 of the asp.net video tutorial, to understand web form caching based on GET and POST requests.

Question asked by the youtube subscriber
When we have set VaryByParam"None", and accessed WebForm1.aspx, the form displayed "All" products as expected. In "Select Product" dropdownlist "All" is selected. Now when I change the selection in the dropdownlist to "iPhone", WebForm1.aspx gets posted back to the server, the form is re-processed. At this point only "iPhone" product is displayed in the gridivew control, and in the dropdownlist "iPhone" is selected.

First Question: Why was the GET request for the webform not cached for "All" products selection in the dropdownlist?
Answer: Actually, the GET request for "All" products selection in the dropdownlist is cached. To retrieve the cached response of the GET request, click any where in the URL address bar in the browser, and press ENTER key. This sends another GET request to the server, which should to return the cached response of the GET request.

Second Question: Why am I not getting the cached response of the GET request when I change the selection in the dropdownlist to "All"?
Answer: This is because, when the selection in the dropdownlist is changed to "All", a POSTBACK request is sent to the server. Since, for the POSTBACK request there is already a cached version of the webform, we get that version. I think, when we set VaryByParam"None", a seperate response is cached for GET and POST requests. I welcome any suggestions to improve this answer. Please leave your valuable comments.

سيتم تفعيل التعليقات قريبا

y
Sep 23, 2020 07:32:26
youtube