Not sure how to make use of cache?

Not sure how to make use of cache?

  1. if (!sessionStorage.getItem('GotTags')) {
  2.         $.ajax({
  3.             url: "Search/GetTags",
  4.             method: "GET",
  5.             datatype: "json",
  6.             success: function (data) {
  7.                 sessionStorage.setItem("tags", JSON.stringify(data.songTags.concat(data.albumTags, data.artistTags)));
  8.                 sessionStorage.setItem('GotTags', 'true');
  9.             }
  10.         });
  11.     }

  12.     $("#searchString").autocomplete({
  13.         source: function (request, response) {
  14.             var tags = JSON.parse(sessionStorage.getItem("tags"));
  15.             var results = $.ui.autocomplete.filter(tags, request.term);

  16.             response(results.slice(0, 10));
  17.         },
  18.         minLength: 3
  19.     });

Okay so the code above gets the tags and stores them in session variable, I only do this once so that it doesn't go through each time the page is refreshed.

My question is can I make use of the Ajax cache to store this information and only go through the function if it isn't cached or is my way fine?

I am not sure how cache works properly yet, how can I access cached variables?