Skip to content

Instantly share code, notes, and snippets.

@luctus
Last active December 26, 2017 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luctus/c9f9050be056b54d6250e9a31061c8c9 to your computer and use it in GitHub Desktop.
Save luctus/c9f9050be056b54d6250e9a31061c8c9 to your computer and use it in GitHub Desktop.
Most Visited Widget

The context

Due to our hight traffic we need to be very careful about how we use different cache technics in order to avoid making extra calls to our servers. We also make use of JS to load small pieces of content that should be more fresh than the whole main pages; One example of this is how we load some widgets you can see in our sidebars.

The problem

We need to generate the "Most Visited" Widget again, reading the content from this endpoint and using our Design Guidelines and our base css file

In a nutshell, you need to make an AJAX call to the provided url, take 3 random elements and build the "Most Visited" widget (See ArchDaily's sidebar for reference.

According to the provided context, we ask you to make use of any local cache technique, in order to avoid unnecessary calls to the endpoint and make sure that the same 3 elements will remain for 2 minutes. So every 2 minutes we should see a different set of 3 elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment