Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When following link from outside world directly to campsite detail page get 404 for a long time #103

Open
mlandauer opened this issue Apr 1, 2017 · 3 comments
Labels

Comments

@mlandauer
Copy link
Owner

mlandauer commented Apr 1, 2017

Now that we have Google indexing https://thatscamping.org it's very likely that a person who's never visited the site before will go directly to a campsite detail page.

Their current experience is:

  • Briefly see content for the website
  • Replaced by 404
  • If they wait around long enough the data will get loaded and they'll see the campsite content again

Obviously a terrible experience.

What would be better is if on a campsite detail page, the campsite data gets loaded as soon as possible. A few different ways that we could do this:

  1. After elm has taken control: Directly load the campsite data from the remote database. Then allow the synching of the databases to take over.
    • Advantage: Simple and not adding more code on the javascript side
    • Disadvantage: We get a flash of 404 (or loading)
  2. Before elm has taken control: See that we're on a campsite detail page and directly load the campsite from the remote database. Then, hand over to elm.
    • Advantage: There will no 404 (or loading) visible to the user at all.
    • Disadvantage: We need to have logic to recognise routes on the javascript side.
  3. Before elm has taken control: If there is no local database, then load all the campsites directly from the remote database. Then, hand over to elm.
    • Advantage: Simple and no flash of 404 for the user.
    • Disadvantage: Slower than option 2
@mlandauer
Copy link
Owner Author

Another option is for the server to send back to the client (alongside the static html), a command or indication of what data the client needs to load.

@mlandauer
Copy link
Owner Author

Related to #85

@mlandauer
Copy link
Owner Author

Implemented option 3 in fed4b58. Let's see how that works in practise before deciding whether that's good enough and whether to close this ticket.

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

No branches or pull requests

1 participant