Caching JSON and AJAX requests

One way by which a web developer can increase the speed of his/her web application is by limiting the number of requests made to the web server. It is very important to ensure that you are making data calls only when you need to. We can use caching to ensure that requests are made only when a new set of data is required.

Getting ready

Ensure that your web server is up and running and you have permission to add files to the server's web root directory.

How to do it…

Learn how to speed up your JavaScript applications using simple caching methods by performing the following instructions:

  1. Create a PHP file named request-6.php in the web root of your web server. Use the following PHP code to create and output a list of names ...

Get jQuery 2.0 Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.