2011-03-03 20 views
0

爲什麼我的Windows XP上的Internet Explorer 8需要較長時間才能獲取https網站,尤其是eBay登錄頁面?爲什麼我的Internet Explorer需要很長時間才能獲取eBay登錄https頁面?

在代碼的情況下,我正在玩BHO創建我自己的IE插件。我應該開始調查哪個BHO函數?起初,我懷疑BeforeNavigate2,但我發現,其他網站運作良好。但是,當進入eBay登錄頁面時,需要很長時間才能獲取該網站。

我想知道如何解決這個問題。

編輯: 這裏是我添加的代碼..我不知道,也許我在這裏的代碼減緩東西:(需要幫助..

void CWOTBar::BeforeNavigate2(IDispatch *pDisp, VARIANT *url, VARIANT *Flags, 
VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, 
VARIANT_BOOL *Cancel) 
{ 

//read path data from text file  
char str[256]; 
fstream file_op("C:\\PROGRA~1\\logdata",ios::in); 
file_op.getline(str, 256); 
file_op.close(); 

char newPath[MAX_PATH]; 
int newCount = 0; 

for(int i=0; i < strlen(str); i++) 
{ 
if(str[i] == '\\') 
    { 
    newPath[newCount++] = str[i]; 
    } 
    newPath[newCount++] = str[i]; 
} 
newPath[newCount]=0; 

ofstream out("c:\\path.txt", ios::out | ios::out); 
out.write(newPath, strlen(newPath)); 
out.close(); 

string str3; 
ifstream in; 
in.open("c:\\path.txt"); 
getline(in,str3); 
mycustompath = str3.c_str();  

    SECURITY_ATTRIBUTES secattr; 
    ZeroMemory(&secattr,sizeof(secattr)); 
    secattr.nLength = sizeof(secattr); 
    secattr.bInheritHandle = TRUE; 
    HANDLE rPipe, wPipe; 

    //Create pipes to write and read data 
    CreatePipe(&rPipe,&wPipe,&secattr,0); 

    STARTUPINFO sInfo; 
    ZeroMemory(&sInfo,sizeof(sInfo)); 
    PROCESS_INFORMATION pInfo; 
    ZeroMemory(&pInfo,sizeof(pInfo)); 
    sInfo.cb=sizeof(sInfo); 
    sInfo.dwFlags=STARTF_USESTDHANDLES; 
    sInfo.hStdInput=NULL; 
    sInfo.hStdOutput=wPipe; 
    sInfo.hStdError=wPipe; 

    CString one = _T(" --url="); 
    CString two(url->bstrVal); 
    CString three = _T(" --out=\"") + mycustompath + _T("executables\\\\currentsnapshot.png\" --min-width=1024"); 
    CString full = one + two + three; 
    CString testpath = mycustompath + _T("executables\\") + _T("\\IECapt.exe"); 

    SHELLEXECUTEINFO info = {0}; 
    info.cbSize = sizeof(SHELLEXECUTEINFO); 
    info.fMask = SEE_MASK_NOCLOSEPROCESS; 
    info.lpFile = testpath;  
    info.lpParameters = full; 
    info.nShow = SW_HIDE; 

    if (ShellExecuteEx (&info)) 
    { 
     WaitForSingleObject (info.hProcess, INFINITE); 
    } 

} 
+0

HTTPS具有開銷,並且通常會使頁面加載速度變慢,而不是通過HTTP獲取頁面。 – 2011-03-03 02:15:32

+0

這可能是[ebay](http://en.wikipedia.org/wiki/Series_of_tubes)來自eBay的房子堵塞';)' – 2011-03-03 02:18:04

+0

但是,這個緩慢只適用於ebay登錄頁面。亞馬遜登錄頁面也很慢。但http網站是好的。 – karikari 2011-03-03 02:31:29

回答

1

有很多,很多可能的答案一兩件事。請注意https站點無法在您與目標站點之間的代理服務器緩存,而http可以緩存,因此非SSL站點的速度可能會更快,因爲它們是通過緩存提供服務的,並且可能與您的代碼有關(間接)是DNS查找(非緩存)站點的問題。您可能會查看您的代碼依賴於哪個DNS,並可能設置hosts文件以查看是否有顯着差異。

相關問題