2
即使預緊禁用,最簡單的<video>
標籤<video>原因很多請求被點擊*
<video src="video.mp4" preload="none"></video>
之前會引起請求到服務器*前被點擊:
89.212.77.133 - - [01/Dec/2010:11:48:43 +0100] "GET /temp/html5-video-requests-test/one-noposter.html HTTP/1.1" 200 267 "-" "Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_0_2 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A400 Safari/6531.22.7"
89.212.77.133 - - [01/Dec/2010:11:48:43 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 2 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:43 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 8621463 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:43 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 101783 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:44 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 8499743 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:44 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:44 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 2 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:44 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 8621463 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:44 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 101783 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:45 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 8505535 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
89.212.77.133 - - [01/Dec/2010:11:48:44 +0100] "GET /temp/html5-video-requests-test/video.mp4 HTTP/1.1" 206 8519680 "-" "AppleCoreMedia/1.0.0.8A400 (iPhone Simulator; U; CPU OS 4_0_2 like Mac OS X; en_us)"
設置海報會減少海報+約。 3個請求。
由於我在頁面上有很多視頻,因此我不希望瀏覽器發出任何請求,直到點擊視頻。
除了設置海報並禁用預加載之外,還可以做些什麼?