System, method and computer program product for efficient caching of hierarchical items
First Claim
1. A method of caching hierarchical items in a network environment, the method comprising:
- performing, by a server computer in the network environment;
caching a copy of a hierarchical navigation tree, the cached copy of the hierarchical navigation tree having nodes representing hierarchical items of a web site, each node in the cached copy of the hierarchical navigation tree having a tree timestamp and a node timestamp;
in response to a change to a first node in the cached copy of the hierarchical navigation tree, updating the tree timestamp and the node timestamp of a parent node of the first node and updating the tree timestamp of any upstream parent node of the parent node of the first node in the cached copy of the hierarchical navigation tree such that only a portion of the cached copy of the hierarchical navigation tree affected by the change to the first node is updated;
comparing the tree timestamp of a root node of the cached copy of the hierarchical navigation tree with a tree timestamp of a root node of a cached copy of a permission tree;
if the tree timestamp of the root node of the cached copy of the hierarchical navigation tree is more recent than the tree timestamp of the root node of the cached copy of the permission tree, comparing the node timestamp of each node in the cached copy of the hierarchical navigation tree and the node timestamp of each node in the cached copy of the permission tree until a dirty node in the cached copy of the permission tree is found;
constructing the dirty node in the cached copy of the permission tree relating to the change to the first node in the cached copy of the hierarchical navigation tree; and
building a portion of the cached copy of the permission tree containing the dirty node by updating the tree timestamp and the node timestamp of the dirty node in the cached copy of the permission tree and traversing the cached copy of the permission tree from the dirty node to the root node of the cached copy of the permission tree to update the tree timestamp of any upstream parent node of the dirty node in the cached copy of the permission tree.
4 Assignments
0 Petitions
Accused Products
Abstract
Embodiments disclosed herein provide a “lazy” approach in caching a hierarchical navigation tree with one or more associated permission trees. In one embodiment, only a portion of a cached permission tree is updated. One embodiment of a method may comprise determining whether a dirty node exists by comparing tree timestamps of the permission tree and the master tree. If the tree timestamp of the master tree is temporally more recent than the tree timestamp of the permission tree, the permission tree has a dirty node and the method may operate to check node timestamps of the master and permission trees. This process may be repeated until the dirty node is found, at which time a portion of the permission tree associated with the dirty node may be reconstructed, rather than the entire permission tree itself, thereby eliminating or significantly reducing access time to the cached permission tree.
35 Citations
21 Claims
-
1. A method of caching hierarchical items in a network environment, the method comprising:
performing, by a server computer in the network environment; caching a copy of a hierarchical navigation tree, the cached copy of the hierarchical navigation tree having nodes representing hierarchical items of a web site, each node in the cached copy of the hierarchical navigation tree having a tree timestamp and a node timestamp; in response to a change to a first node in the cached copy of the hierarchical navigation tree, updating the tree timestamp and the node timestamp of a parent node of the first node and updating the tree timestamp of any upstream parent node of the parent node of the first node in the cached copy of the hierarchical navigation tree such that only a portion of the cached copy of the hierarchical navigation tree affected by the change to the first node is updated; comparing the tree timestamp of a root node of the cached copy of the hierarchical navigation tree with a tree timestamp of a root node of a cached copy of a permission tree; if the tree timestamp of the root node of the cached copy of the hierarchical navigation tree is more recent than the tree timestamp of the root node of the cached copy of the permission tree, comparing the node timestamp of each node in the cached copy of the hierarchical navigation tree and the node timestamp of each node in the cached copy of the permission tree until a dirty node in the cached copy of the permission tree is found; constructing the dirty node in the cached copy of the permission tree relating to the change to the first node in the cached copy of the hierarchical navigation tree; and building a portion of the cached copy of the permission tree containing the dirty node by updating the tree timestamp and the node timestamp of the dirty node in the cached copy of the permission tree and traversing the cached copy of the permission tree from the dirty node to the root node of the cached copy of the permission tree to update the tree timestamp of any upstream parent node of the dirty node in the cached copy of the permission tree. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
9. A computer program product comprising at least one non-transitory computer readable medium storing instructions translatable by a server computer where a copy of a hierarchical navigation tree is cached, the cached copy of the hierarchical navigation tree having nodes representing hierarchical items of a web site, each node in the cached copy of the hierarchical navigation tree having a tree timestamp and a node timestamp, the instructions when translated by the server computer cause the server computer to perform:
-
in response to a change to a first node in the cached copy of the hierarchical navigation tree, updating the tree timestamp and the node timestamp of a parent node of the first node and updating the tree timestamp of any upstream parent node of the parent node of the first node in the cached copy of the hierarchical navigation tree such that only a portion of the cached copy of the hierarchical navigation tree affected by the change to the first node is updated; comparing the tree timestamp of a root node of the cached copy of the hierarchical navigation tree with a tree timestamp of a root node of a cached copy of a permission tree; if the tree timestamp of the root node of the cached copy of the hierarchical navigation tree is more recent than the tree timestamp of the root node of the cached copy of the permission tree, comparing the node timestamp of each node in the cached copy of the hierarchical navigation tree and the node timestamp of each node in the cached copy of the permission tree until a dirty node in the cached copy of the permission tree is found; constructing the dirty node in the cached copy of the permission tree relating to the change to the first node in the cached copy of the hierarchical navigation tree; and building a portion of the cached copy of the permission tree containing the dirty nodes in node by updating the tree timestamp and the node timestamp of the dirty node in the cached copy of the permission tree and traversing the cached copy of the permission tree from the dirty node to the root node of the cached copy of the permission tree to update the tree timestamp of any upstream parent node of the dirty node in the cached copy of the permission tree. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A system, comprising:
a server computer caching a copy of a hierarchical navigation tree, the cached copy of the hierarchical navigation tree having nodes representing hierarchical items of a web site, each node in the cached copy of the hierarchical navigation tree having a tree timestamp and a node timestamp, the server computer configured to perform; in response to a change to a first node in the cached copy of the hierarchical navigation tree, updating the tree timestamp and the node timestamp of a parent node of the first node and updating the tree timestamp of any upstream parent node of the parent node of the first node in the cached copy of the hierarchical navigation tree such that only a portion of the cached copy of the hierarchical navigation tree affected by the change to the first node is updated; comparing the tree timestamp of a root node of the cached copy of the hierarchical navigation tree with a tree timestamp of a root node of a cached copy of a permission tree; if the tree timestamp of the root node of the cached copy of the hierarchical navigation tree is more recent than the tree timestamp of the root node of the cached copy of the permission tree, comparing the node timestamp of each node in the cached copy of the hierarchical navigation tree and the node timestamp of each node in the cached copy of the permission tree until a dirty node in the cached copy of the permission tree is found; constructing the dirty node in the cached copy of the permission tree relating to the change to the first node in the cached copy of the hierarchical navigation tree; and building a portion of the cached copy of the permission tree containing the dirty node by updating the tree timestamp and the node timestamp of the dirty node in the cached copy of the permission tree and traversing the cached copy of the permission tree from the dirty node to the root node of the cached copy of the permission tree to update the tree timestamp of any upstream parent node of the dirty node in the cached copy of the permission tree. - View Dependent Claims (16, 17, 18, 19, 20, 21)
Specification