A method, a system, an apparatus, and a computer program product are
presented for a fragment caching methodology. After a message is received
at a computing device, a fragment in the message body is cached. Cache ID
rules from an origin server accompany a fragment to describe a method for
forming a unique cache ID for the fragment such that dynamic content can
be cached away from an origin server. A cache ID may be based on a URI
and/or query parameters and/or cookies that are associated with a
fragment. After user authentication, a cookie containing the user's role
may be used in subsequent requests for role-specific fragments and in the
cache identifier for role-specific fragments, thereby allowing requests
from other users for role-specific fragments to be resolved in the cache
when the users have the same role because these users would also have the
same cookie.