Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many...

18
Web Caching Web Caching By By Neeraj Agrawal Neeraj Agrawal

Transcript of Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many...

Page 1: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

Web CachingWeb Caching

ByBy

Neeraj AgrawalNeeraj Agrawal

Page 2: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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..

Page 3: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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.

Page 4: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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.

Page 5: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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

Page 6: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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

Page 7: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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.

Page 8: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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

Page 9: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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

Page 10: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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

Page 11: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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?

Page 12: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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

Page 13: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

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

Page 14: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

WeaveLWeaveL

Page 15: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

XML FragmentXML Fragment

Page 16: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

Weave Web Site Management Weave Web Site Management SystemSystem

Page 17: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

Runtime PoliciesRuntime Policies

Page 18: Web Caching By Neeraj Agrawal. Caching Caching is widely used for improving performance in many context( e.g processor caches in hardware, buffer pool.

ConclusionConclusion

ResultsResults

Better performance with mixed Better performance with mixed cachingcaching