call aspx page to return an image randomly slow

前端 未结 1 588
囚心锁ツ
囚心锁ツ 2020-11-30 15:41

OK, here is the question, I have a asp.net website, there is an aspx page called GetThumbnail.aspx, the code is like below:

string newThumbnailPath = ReaderU         


        
相关标签:
1条回答
  • 2020-11-30 16:04

    Because you use .aspx page (and not handler), and because the images loaded by browser not one by one, but many together, I suspect that you felt on the session lock of the page and that's why this delay.

    Try to set EnableSessionState="false" on the page.

    eg:

    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" 
        AutoEventWireup="false" Inherits="WebApplication1.WebForm1" 
         EnableSessionState="false" %>
    

    By the way, if you change the aspx page to a handler page you going to gain some more speed because the handler page did not make all the calls that a normally page do.

    0 讨论(0)
提交回复
热议问题