Book Image

MEAN Cookbook

By : Nicholas McClay
Book Image

MEAN Cookbook

By: Nicholas McClay

Overview of this book

The MEAN Stack is a framework for web application development using JavaScript-based technologies; MongoDB, Express, Angular, and Node.js. If you want to expand your understanding of using JavaScript to produce a fully functional standalone web application, including the web server, user interface, and database, then this book can help guide you through that transition. This book begins by configuring the frontend of the MEAN stack web application using the Angular JavaScript framework. We then implement common user interface enhancements before moving on to configuring the server layer of our MEAN stack web application using Express for our backend APIs. You will learn to configure the database layer of your MEAN stack web application using MongoDB and the Mongoose framework, including modeling relationships between documents. You will explore advanced topics such as optimizing your web application using WebPack as well as the use of automated testing with the Mocha and Chai frameworks. By the end of the book, you should have acquired a level of proficiency that allows you to confidently build a full production-ready and scalable MEAN stack application.
Table of Contents (13 chapters)

HTTP service optimization through client-side caching

Making lots of API requests in a modern web application is normal, but being more careful about limiting when, and if, we make additional requests can make a big difference in the performance of our application. Caching is a common solution that can be employed to prevent making requests for content we already have loaded in our application.

Getting Ready

Let's provide a caching strategy for our BlogPosts service. We'll build a cache of blog post results when we load them for the first time. After that, if we request the same data, it will simply load from a cache instead of making another HTTP request for the same data.

Before getting started, we will need to...