4 ms·
I wonder if you could fetch the logged-out page first and then re-render client-side what's missing for a logged-in user. Also, Firefox container tabs might be
by tuukkah 3y ago
I wonder if you could fetch the logged-out page first and then re-render client-side what's missing for a logged-in user.
Also, Firefox container tabs might be a nice solution: normally browse in a container where I'm logged out, then to edit, change the tab to my Wikipedia container where I'm logged in.
- undefinedzero 3y agoThis is what client side apps do (e.g. React). They come with their own set of challenges which when not solved correctly turn into downsides. Probably still easier for Wikipedia to do than fixing their backend.
- adrr 3y agoThats what we did a former company. You cache the main page on the edges of a CDN. When logged in, you'll get JSON blob that is also cached on the edges using oauth/jwt header as a dimension for the cache key. JSON blob has the users information like username, name etc and its just filled in. Makes the pages extremely performant since everything is cached on edges and protects your origin servers from load. You could also shove stuff into web storage but private mode for some browsers won't persist the data.
- underwater 3y agoI've seen this backfire when someone breaks the configuration of the cache key. All of a sudden people start getting back usernames and personal information of random users.
- bawolff 3y agoWell it could be the entire page and then you would get a giant flash or repaints. It is not clear that is any better. The main things that are different: * the user links (shows what user you are logged in) * whether you have a new message notification * your skin preferences (this will totally change the entire html) * your language preference (normally this only affects the UI not page content, but some pages it affects page content) * other misc preferences can affect wikipage content (e.g thumbnail size), although there has been a general effort to avoid adding new ones and remove existing ones that arent used. * some stuff makes assumptions about logged in users not being varnish (e.g. how csrf tokens work for js based actions), but most of those can be changed if push came to shove. That said there might be a reasonable argument that much of this isnt needed and it would be a net benefit to kill most of those features.
- tuukkah 3y agoYeah, if you use a user setting such as a non-default skin, you should arguably instead install a browser extension or use a client app built on top of PCS (the Page Content Service API): https://en.wikipedia.org/api/rest_v1/#/Page%20content https://en.wikipedia.org/api/rest_v1/#/Page%20content https://www.mediawiki.org/wiki/Page_Content_Service https://www.mediawiki.org/wiki/Page_Content_Service