Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Pages behind login #10

Closed
dnesteryuk opened this issue Nov 7, 2016 · 1 comment
Closed

Pages behind login #10

dnesteryuk opened this issue Nov 7, 2016 · 1 comment

Comments

@dnesteryuk
Copy link
Collaborator

Scenario:

  1. A user is on the login page: http://localhost/login.
  2. The user logins and gets forwarded to the internal page: http://localhost/index.

First of all the index page is private, it cannot be pre-rendered. Even if the index page is public, the page may be personalized after the login, hence, it must not be pre-rendered. Otherwise, the user will see the stale content.

How to handle such case?

@dnesteryuk dnesteryuk added this to the 0.1 milestone Nov 26, 2016
@dnesteryuk dnesteryuk removed this from the 0.1 milestone Jan 25, 2017
dnesteryuk added a commit to sirko-io/client that referenced this issue Dec 18, 2017
Also fixes: sirko-io/engine#10, sirko-io/engine#15

When a user navigates between pages, there might be POST/PUT/DELETE
requests. Those requests modify state, so a prefetched page might be
stale.

Example

  GET /signin
  POST /signin
  GET /index

If the transition between the signin and index pages got tracked,
the index page would be prefetched when the user opens the signin page.
This behavior's been leaded to a number of issues.

To avoid the described issue, the service worker
stores all made requests on a page then the client part
asks the service worker to check whether there was a POST/PUT/DELETE
request between the referrer and the current page. If so,
the transition isn't tracked (the referrer parameter gets removed, thus,
the engine doesn't track the transition), but the engine makes a prediction
for the current page anyway. The transition is about the previous
and the current page, the prediction is about the next page.
@dnesteryuk
Copy link
Collaborator Author

This case is handled by the client. See the attached commit for more details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant