简体   繁体   中英

Is it possible to create incognito/private mode dynamically with code?

This is not a question about how to turn on incognito/private mode on a browser, but rather what kinds of things are turned on or off by browsers when that mode is entered, and whether those things can be done dynamically with (presumably) client-side code on the site itself.

I ask because, reason unknown, my site runs faster in incognito/private mode than otherwise. The difference in speed is greatest in IE, which runs at a snail's pace normally, but is faster than all other browsers when my site is executed in its InPrivate viewing mode.

My site involves complex database queries for text and image retrieval from the server, things I wouldn't ordinarily think would be sped up by incognito mode; thus, I'm looking for (1) listings of the various things that browsers do when opened in that mode, and (2) what can be done code-wise (if at all) to effect those conditions when my site executes on a client's browser.

"Is it possible to create incognito/private mode dynamically with code?"

No it's not.

You can't prevent the browser from storing your navigation / download history, cache, and whatever else isn't stored in incognito mode.

JavaScript simply doesn't have that kind of access.

Instead of working around the problem by "forcing" incognito mode like this, it may be more productive, in the long run, to determine what's causing the site to run so slowly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM