Post on 21-Jul-2020
transcript
Enhancing Adobe Experience Manager (CQ5) with Varnish
Dan Beldiman, Senior System Engineer 28. November 2013
About netcentric
Founded 2012 focused on Web Experience Projects
80 Employees inMünchen, Zürich, London und Barcelona
Focus onAdobe CQ5
2
AGEN
DA
1 Adobe Experience Manager (AEM)
2 Caching with AEM
3 Varnish with AEM
4 Q & A
1 ADOBE EXPERIENCE MANAGER
What is Adobe Experience Manager (AEM)?
An easy-to-use unified web content management solution
Create, and deliver personalized online experiences
Formerly known as "CQ5"
5
Easy to use, great look and feel
6
AEM technical setup: The big picture
Content Replication
Request content from web server
Via load- balancer
If not cached, request content from Publish
Content request form web- server with dispatcher cache
Author Surfer
Publish
Author Load
Balancer
Web Server
Publish Web Server
7
AEM technical setup: How cache flushing works
Apache Webserver
CQ5 Publisher
Docroot
Web request
Dispatcher Module
Request from CQ if not in cache
Page activation
Local cache
Cache Flush request
GET/dispatcher/ invalidate.cache HTTP/1.1"
CQ-Path: /content/mysite/mypage"
8
2 CACHING WITH AEM
AEM Caching module: Dispatcher
A Web server module for Apache httpd, Microsoft IIS and others
Stores cachable objects in the docroot
Basic flushing & invalidation support
Support for multiple virtual hosts
10
How the Dispatcher returns documents
11
Source: https://dev.day.com/docs/en/cq/current/deploying/dispatcher.html
If not cachable, return document
If cachable, put document into cache
Yes, take document from cache
Yes
Yes
No
No
No
Is the request cachable?
Is it cached?
Is it up to date?
Render the document
Document request
Document
DISPATCHER
CACHE
Why change the Dispatcher?
Due to it's nature it can only cache the body of a response § No redirects
As the request handling is done by the underlying web server, concurrency is a big issue § Multiple requests to the same complex pages
Rules for high-traffic or complex pages cannot easily be configured § Workarounds using RewriteRules…
12
Why Varnish?
Because Varnish is awesome J
Caching and flushing can be defined fine grained § Logic of content references can be built into flush rules
Is fast and reliable § Used in Intranet where CDN is not an option for web acceleration
Caching of non-html responses is possible § Caching of redirects
13
3 VARNISH WITH AEM
CQ5 Technical setup: publishing details using varnish
CQ5 Publisher
Varnish
Apache Webserver
Request from CQ if not in cache
Web request
Page activation
Cache Flush request
15
What does it take for a basic integration?
if (req.url == "/dispatcher/invalidate.cache"){ if(req.http.CQ-Handle){ ban("obj.http.x-url ~ ^"+req.http.CQ-Handle+"[^/]*$"); std.log("Banning: "+"obj.http.x-url ~ ^"+req.http.CQ-Handle+"[^/]*$"); }
}
Literally one condition with a ban statement …
16
What else can we achieve?
Improve flushing/ invalidation through specific rules
Change flush behaviour dynamically
Control cache through the admin interface
17
dan.beldiman@netcentric.biz Tel: +49 170 5844847
Landsberger Strasse 110Central Tower80339 Munich
18
Dan Beldiman
Netcentric Deutschland GmbH
Poststrasse 58805 Pfäffikon
Netcentric AG
Avenida Diagonal 1238ª Planta08005 Barcelona
Netcentric Iberia S.L.
Nordstrasse 98006 Zurich
Holland HouseGherkin Piazza, 1 – 4 Bury StreetLondonEC3A 5AW
Netcentric UK Limited
Q A
Contact