web caching by neeraj agrawal. caching caching is widely used for improving performance in many...
TRANSCRIPT
Web CachingWeb Caching
ByBy
Neeraj AgrawalNeeraj Agrawal
CachingCaching
Caching is widely used for improving Caching is widely used for improving performance in many context( e.g performance in many context( e.g processor caches in hardware, buffer processor caches in hardware, buffer pool in DBMS etc).pool in DBMS etc). Where and what to cache in web Where and what to cache in web
context?context? Many points and many kind of objects!Many points and many kind of objects!
Focus is on Transactional/Database appsFocus is on Transactional/Database apps..
What Where When and HowWhat Where When and How
Considerations for caching in web Considerations for caching in web context are:context are: What, when and where to cacheWhat, when and where to cache Granularity of caching: Granularity of caching: web pages, web pages,
fragments of pages, servlet execution result, fragments of pages, servlet execution result, SQL query results etcSQL query results etc
Location of cache: client, proxy, edge of the net, Location of cache: client, proxy, edge of the net, internet service provider (ISP), edge of internet service provider (ISP), edge of enterprise, application server (EJBs etc), web enterprise, application server (EJBs etc), web server, database server. server, database server.
What Where When and HowWhat Where When and How
Caching and Invalidating policies: Caching and Invalidating policies: Pull Pull vs Push, freshness maintenance, triggers.vs Push, freshness maintenance, triggers.
Related DB Technologies: Related DB Technologies: Replication Replication Materialized viewsMaterialized views Mediator systems Mediator systems Buffer management.Buffer management.
Common Points of CachingCommon Points of Caching
BrowserBrowser Proxy (Forward proxy cache)Proxy (Forward proxy cache) Enterprise/ISP Edge ServersEnterprise/ISP Edge Servers Web Server Web Server Application ServerApplication Server DatabasesDatabases
Cache ModelsCache Models Front End CacheFront End Cache
Caches data + markupCaches data + markup Cache can be app independentCache can be app independent Static pages easily cachedStatic pages easily cached
Data CacheData Cache Cache DataCache Data Effectiveness depends on app Effectiveness depends on app
designdesign
Cache ModelsCache Models
Distributed Distributed ApplicationsApplications Multiple copies Multiple copies
distributed around distributed around netnet
Turns caching into Turns caching into content management content management problem.problem.
HTTP Caching TodayHTTP Caching Today
Multiple cache between browser and serverMultiple cache between browser and server HTTP header controlHTTP header control
Whether a page can be cached Whether a page can be cached Cache expiration time.Cache expiration time.
Full pages and images can be cached.Full pages and images can be cached. Unable to cache html fragmentsUnable to cache html fragments
Dynamically Generated Dynamically Generated PagesPages
Increased due toIncreased due to Database centric e-commerce Database centric e-commerce
applicationapplication Frequently update contentsFrequently update contents PersonalizationPersonalization
Proxy caching is ineffective for such Proxy caching is ineffective for such pagespages
Caching Data-intensive Web Caching Data-intensive Web SitesSites
Relies on the declarative spec of web sitesRelies on the declarative spec of web sites Data content is extracted from DBMSData content is extracted from DBMS Website structure and content is separate Website structure and content is separate
from graphical representation XSLT.from graphical representation XSLT. The mapping between raw data and logical The mapping between raw data and logical
model of web is described by declarative model of web is described by declarative language (WeaveL)language (WeaveL)
HTML page is generated from XML and XSLTHTML page is generated from XML and XSLT
Materialization Strategies Materialization Strategies
What kind of data must be materialized?What kind of data must be materialized? When must materialization must be When must materialization must be
performed?performed? Where should the materialized intermediate Where should the materialized intermediate
result must be placed for effective result must be placed for effective performance improvements?performance improvements?
How are updates are propagated to the How are updates are propagated to the materialized data?materialized data?
Which particular data must be materialized Which particular data must be materialized and which must be computed upon request?and which must be computed upon request?
ApproachesApproaches Materialization (HTML)Materialization (HTML)
Good response timeGood response time High space overhead High space overhead Propagating update to materialization Propagating update to materialization
difficultdifficult Not always possible (forms)Not always possible (forms) Materialization granularity is not always Materialization granularity is not always
appropriateappropriate
ApproachesApproaches
Cache DBMS query resultsCache DBMS query results Significant performance improvementSignificant performance improvement Simple update propagation Simple update propagation GranularityGranularity
Cache intermediate XMLCache intermediate XML Complex update propagationComplex update propagation GranularityGranularity Eliminate cost of database connectionEliminate cost of database connection
WeaveLWeaveL
XML FragmentXML Fragment
Weave Web Site Management Weave Web Site Management SystemSystem
Runtime PoliciesRuntime Policies
ConclusionConclusion
ResultsResults
Better performance with mixed Better performance with mixed cachingcaching