IP Library Granted Patent US 9,489,306
Granted Patent B1
US 9,489,306 · App. 14/717,860 · Granted Nov 8, 2016

Performing efficient cache invalidation

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,489,306
App. No.
14/717,860
Granted
Nov 8, 2016
Kind
B1
Abstract

Performing cache invalidation is disclosed, including: receiving an invalidation request to invalidate one or more invalidated cache entries of a cache storage, wherein the cache storage is configured to store cache entries; storing the invalidation request to invalidate the one or more invalidated cache entries in an invalidation data structure; prior to removing the one or more invalidated cache entries from the cache storage, receiving a data retrieval request for a requested cache entry from the cache storage; and using the invalidation data structure to determine whether the requested cache entry has been invalidated.

Claims (73)

1. A system, comprising:

a cache storage configured to store cache entries; and

a processor coupled to the cache storage and configured to:

receive an invalidation request to invalidate one or more invalidated cache entries of the cache storage;

store the invalidation request to invalidate the one or more invalidated cache entries in an invalidation data structure;

prior to removing the one or more invalidated cache entries from the cache storage, receive a data retrieval request for a requested cache entry from the cache storage; and

use the invalidation data structure to determine whether the requested cache entry has been invalidated.

2. The system of claim 1 , wherein the invalidation request comprises an invalidation pattern and an invalidation timestamp.

3. The system of claim 2 , wherein the invalidation pattern is usable to identify the one or more invalidated cache entries of the cache storage.

4. The system of claim 2 , wherein the invalidation pattern comprises one or more of the following: a key, value, and creation time information.

5. The system of claim 1 , wherein to store the invalidation request to invalidate the one or more invalidated cache entries in the invalidation data structure comprises to:

determine whether an invalidation pattern included in the invalidation request matches an invalidation pattern associated with an existing invalidation entry of the invalidation data structure;

in the event that the invalidation pattern included in the invalidation request matches the invalidation pattern associated with the existing invalidation entry of the invalidation data structure, update the existing invalidation entry with an invalidation timestamp included in the invalidation request, and

in the event that the invalidation pattern included in the invalidation request does not match invalidation patterns associated with existing invalidation entries of the invalidation data structure, generate a new invalidation entry in the invalidation data structure with the invalidation pattern and the invalidation timestamp included in the invalidation request.

6. The system of claim 1 , wherein to use the invalidation data structure to determine whether the requested cache entry has been invalidated comprises to:

determine that a requested key included in the data retrieval request matches a matching cache entry in the cache storage;

determine that the requested key matches a matching invalidation entry in the invalidation data structure; and

determine whether a creation timestamp associated with the matching cache entry is later than an invalidation timestamp associated with the matching invalidation entry:

in the event that the creation timestamp associated with the matching cache entry is later than the invalidation timestamp associated with the matching invalidation entry:

determine that the matching cache entry is valid; and

return data associated with the matching cache entry; and

in the event that the creation timestamp associated with the matching cache entry is not later than the invalidation timestamp associated with the matching invalidation entry:

determine that the matching cache entry is invalidated; and

forward the data retrieval request to a backend server.

7. The system of claim 6 , wherein to determine whether the creation timestamp associated with the matching cache entry is later than the invalidation timestamp associated with the matching invalidation entry comprises to determine a latest invalidation timestamp of a plurality of invalidation timestamps associated with the matching invalidation entry.

8. The system of claim 6 , wherein to determine that the requested key included in the data retrieval request matches the matching cache entry in the cache storage comprises to compare the requested key to cache entries in the cache storage other than those cache entries associated with expired time to live (TTL) values.

9. The system of claim 1 , wherein to use the invalidation data structure to determine whether the requested cache entry has been invalidated comprises to:

determine that a requested key included in the data retrieval request matches a matching cache entry in the cache storage;

determine that the requested key does not match a matching invalidation entry in the invalidation data structure; determine that the matching cache entry is valid; and

return data associated with the matching cache entry.

10. The system of claim 1 , wherein a cache entry in the cache storage comprises a key-value pair and a creation timestamp.

11. The system of claim 1 , wherein the processor is further configured to:

obtain requested data from a backend server;

determine to cache the requested data based at least in part on a caching policy; and

write the requested data as one or more cache entries in the cache storage with corresponding creation time information.

12. The system of claim 1 , wherein the processor is further configured to:

determine an invalidation entry in the invalidation data structure, wherein the invalidation entry comprises an invalidation pattern;

determine one or more cache entries in the cache storage that match the invalidation pattern;

remove the matching one or more cache entries from the cache storage; and

remove the invalidation entry from the invalidation data structure.

13. The system of claim 1 , wherein the data retrieval request comprises an application programming interface (API) request.

14. The system of claim 1 , wherein the data retrieval request comprises a hypertext transfer protocol (HTTP) request uniform resource identifier (URI).

15. The system of claim 1 , wherein the invalidation request is generated in response to a user input received at a backend server.

16. The system of claim 1 , wherein the cache storage and the invalidation data structure are stored in a same storage.

17. The system of claim 1 , wherein the cache storage is stored in a first storage and the invalidation data structure is stored in a second storage.

18. The system of claim 17 , wherein the first storage comprises hard disk and the second storage comprises memory.

19. A method, comprising:

receiving an invalidation request to invalidate one or more invalidated cache entries of a cache storage, wherein the cache storage is configured to store cache entries;

storing the invalidation request to invalidate the one or more invalidated cache entries in an invalidation data structure;

prior to removing the one or more invalidated cache entries from the cache storage, receiving a data retrieval request for a requested cache entry from the cache storage; and

using, by one or more processors, the invalidation data structure to determine whether the requested cache entry has been invalidated.

20. The method of claim 19 , wherein the invalidation request comprises an invalidation pattern and an invalidation timestamp.

21. The method of claim 20 , wherein the invalidation pattern is usable to identify the one or more invalidated cache entries of the cache storage.

22. The method of claim 20 , wherein the invalidation pattern comprises one or more of the following: a key, value, and creation time information.

23. The method of claim 19 , wherein storing the invalidation request to invalidate the one or more invalidated cache entries in the invalidation data structure comprises:

determining whether an invalidation pattern included in the invalidation request matches an invalidation pattern associated with an existing invalidation entry of the invalidation data structure;

in the event that the invalidation pattern included in the invalidation request matches the invalidation pattern associated with the existing invalidation entry of the invalidation data structure, updating the existing invalidation entry with an invalidation timestamp included in the invalidation request, and

in the event that the invalidation pattern included in the invalidation request does not match invalidation patterns associated with existing invalidation entries of the invalidation data structure, generating a new invalidation entry in the invalidation data structure with the invalidation pattern and the invalidation timestamp included in the invalidation request.

24. The method of claim 19 , wherein using the invalidation data structure to determine whether the requested cache entry has been invalidated comprises:

determining that a requested key included in the data retrieval request matches a matching cache entry in the cache storage;

determining that the requested key matches a matching invalidation entry in the invalidation data structure; and

determining whether a creation timestamp associated with the matching cache entry is later than an invalidation timestamp associated with the matching invalidation entry:

in the event that the creation timestamp associated with the matching cache entry is later than the invalidation timestamp associated with the matching invalidation entry:

determining that the matching cache entry is valid; and

returning data associated with the matching cache entry; and

in the event that the creation timestamp associated with the matching cache entry is not later than the invalidation timestamp associated with the matching invalidation entry:

determining that the matching cache entry is invalidated; and

forwarding the data retrieval request to a backend server.

25. A computer program product, the computer program product being embodied in a non-transitory computer readable storage medium and comprising computer instructions for:

receiving an invalidation request to invalidate one or more invalidated cache entries of a cache storage, wherein the cache storage is configured to store cache entries;

storing the invalidation request to invalidate the one or more invalidated cache entries in an invalidation data structure;

prior to removing the one or more invalidated cache entries from the cache storage, receiving a data retrieval request for a requested cache entry from the cache storage; and

using the invalidation data structure to determine whether the requested cache entry has been invalidated.

Assignments (4)
CHANGE OF NAME Recorded Oct 2, 2017
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 044097/0658 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 12, 2017
From: APIGEE CORPORATION
To: GOOGLE INC.
Reel/Frame 040955/0070 →
CORRECTIVE ASSIGNMENT TO CORRECT THE SECOND INVENTOR'S FIRST NAME PREVIOUSLY RECORDED ON REEL 036470 FRAME 0179. ASSIGNOR(S) HEREBY CONFIRMS THE CHANGE OF THE SECOND INVENTOR'S NAME FROM VENDANT TO VEDANT. Recorded Oct 19, 2015
From: MURUGESAN, VIJAYAKUMAR; BHANGALE, VEDANT
To: APIGEE CORPORATION
Reel/Frame 036897/0440 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 1, 2015
From: MURUGESAN, VIJAYAKUMAR; BHANGALE, VENDANT
To: APIGEE CORPORATION
Reel/Frame 036470/0179 →