When using "Back" button, preload previous content from local storage


(Anton) #1

When I click on the “Back” button and it redirects me back to Popular or New section, we could show previous list of topics (maybe cached in local storage) while loading all updates (instead of showing black “Loading…” text).

Thus it will be more static and less irritating for eyes.


(Doug Moore) #3

Do you think it would be less irritating for the content to change after you have started to process it?


(Anton) #4

Practically, what do you think can be changed that will be irritating?

  • Adding another topic - not a problem, it can be added in the way to keep content unmoved;
  • Changing participants, number of posts etc - will be not irritation at all, it can just accurately update in right place while I’m reading titles of topics listed on the page;
  • Changing title? Well, this is the only thing that can be irritation - but it will happen so rare in practice.

Cannot re-format my answer, it says content looks very similar to previous one
(Anton) #5

The idea was to do the update silently, in background (and do not show that Loading… at all).

My own feeling is that when I navigate and use forum actively in more then 10 minutes, it becomes really annoying to see that black “Loading…” all the time.

Every page is loading on the net when I open it, so I do know that it is loading or updating something when I just starting the page, but why must I see “Loading…” message. To me it is ugly.

From my point of view, static content is more readable. Because Discource is primarily oriented for reading, it must look like static and silent, not like youtube or any other multimedia website. Hope it makes sense.


(Doug Moore) #6

Removing the topic you just read if you are coming from the unread list originally (unread -> article -> back to unread)


(Anton) #7

This is not an issue at all from programming point of view. In such a case (and because it is JS application) it can be removed from local user cache (aka local storage) exactly at a time when you open that topic for reading.

Then you click “Back” button and voila - you do not see it anymore in the list, and JS loader starts to do its job in background, like proposed above.


(Jeff Atwood) #8

We already do this when coming back to topic lists from a topic. However you must have scrolled down a bit to trigger it, I believe.

The thinking is that as you scroll down in topic lists you are getting into older stuff that is less likely to change. Whereas if you are at the top, that stuff is going to be very very recent and we want the latest information there, so re-load from server.

In any case, we always fade from yellow the topic you last clicked on, so you know where you are.


(Anton) #9

You are right, I made a test and it worked with cache, without showing “Loading…” message at all - this is very good.

But why it is so slow? Really. Can the speed of HTML generation in such a case be improved.
It does not feel like a usual “back” button behavior when it is slow.
It would be much much better when it will be immediate - like it happens with usual web pages.

Are we caching json or both json and HTML which is ready to use?

Also, do you think technique proposed above willl not do the job with most recent topics list?


(Jeff Atwood) #10

Speed should be better since this was written. Ember improvements, lighter default CSS load, etc. Also maybe you upgraded your computer since this was written? We are playing a long game here at Discourse :slight_smile:

Also more templating improvements coming with HTMLbars, which is supposed to be many times faster than current templating engine in Ember.


(Anton) #11

Thanks for the update.

I haven’t recently notified any distracting or irritative effects while using Discourse Meta, however I haven’t been using it the same intensively as when the original request had been written.

So we could conclude that the usability in this area has been greatly improved.

Re upgrading my computer, it was always one of the top models, with multiple cores and 8GB DDR2 or DDR3. So I don’t think it could affect the flow.