如何通过无头镀铬驱动程序设置缓存控制值?
选项:
options.addArguments("--no-sandbox");
options.addArguments("--window-size=1920,1080");
options.addArguments("--start-maximized");
options.addArguments("--disable-gpu");
options.addArguments("--enable-application-cache");
options.addArguments("--Cache-Control=max-age=1000"); //'Cache-Control':'max-age=0'
options.addArguments("--lang=en-US,en");
options.addArguments("--user-agent=\"Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko\"");
ChromeDriver 2.34.522940
options.setHeadless(假);
GET / HTTP/1.1
Host: localhost
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko"
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
options.setHeadless(真);
GET / HTTP/1.1
Host: localhost
Connection: keep-alive
User-Agent: "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko"
Upgrade-Insecure-Requests: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9