Simple play icon Course

Caching JavaScript REST API Data with Local Storage

by James Millar

This course will teach you how to leverage the HTML storage API to store JSON data as well as exploring alternatives such as pouchDB.

What you'll learn

Storing API data client-side and keeping it synchronized can be a challenge, but if done well it can increase performance and improve the user experience. In this course, Caching JavaScript REST API Data with Local Storage, you’ll learn how to use local storage and pouchDB to store and maintain data received from a restful API. First, you’ll explore how local caching works and explore the differences between the different options. Next, you’ll discover how to retrieve data from an API and store it locally. Finally, you’ll learn how to store JSON documents in pouchDB. When you’re finished with this course, you’ll have the skills and knowledge of the HTML local storage API needed to store Rest API data locally in the browser.

Course FAQ

Who is this course for?

This course is for anyone interested in understanding local storage and PouchDB. Caching JavaScript REST API Data with Local Storage course will provide you with all the skills you need to add local storage functionality into your web apps.

What is JSON Data?

JSON (JavaScript Object Notation) is most widely used data format for data interchange on the web. It is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client so it can be displayed on a web page, or vice versa). It is based on a subset of the JavaScript programming language and it is easy to understand and generate.

Why is JSON Popular?

JSON is the ubiquitous, de facto format for sending data between web servers and browsers and mobile applications. Its simple design and flexibility make it easy to read and understand, and in most cases, easy to manipulate in the programming language of your choice.

What is a REST API?

A REST API is a way of easily accessing web services without having excess processing. Whenever a RESTful API is called, the server will transfer to the client a representation of the state of the requested resource. A REST API is a way for two computer systems to communicate over HTTP in a similar way to web browsers and servers.

What is PouchDB?

PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser. PouchDB was created to help web developers build applications that work as well offline as they do online.

What is local storage?

Local storage is a type of web storage that allows JavaScript sites and apps to store and access data right in the browser with no expiration date. This means the data stored in the browser will persist even after the browser window has been closed.

About the author

James Millar is a freelance software development consultant based in Malmesbury, England who has worked for some of the world’s biggest brands. He started his career over a decade ago writing training materials for Microsoft and moved into industry to further develop his skills. Having worked for multiple industries including automotive and process automation has been fortunate enough to work on some major projects operating at global scale. He has a passion for back end services and infrastruct... more

Ready to upskill? Get started