om

t.c
ar
EXPERIMENTS

m
PAGE FRAGMENT CACHING
is
br
VARNISH AND NGINX
hy

CONFIDENTIAL 73
PAGE FRAGMENT CACHING

om
Product
Browser JSP Component
Page controller Hybris CMS Facades/services
PARTIALLY IN-SCOPE controllers

t.c
Product data (model)
Product page

ar
Any custom hybris
template (view)
CMS tags?

m
FOR EACH hybris custom tag
IN-SCOPE OF THE CACHING ENGINE

Retrieving a list
pageSlot of components

is
FOR EACH component
br HTML
hy

CONFIDENTIAL 74
PAGE FRAGMENT CACHING

om
Caching option #1

t.c
ar
BrowserCache Hybris Cache testcache
HTTP/ CustomTags

m
HTTPS
80/443
User Hybris MongoDB

is
br
hy

CONFIDENTIAL 75
PAGE FRAGMENT CACHING

om
t.c
ar
m
is
br
hy

CONFIDENTIAL 76
PAGE FRAGMENT CACHING

om
t.c
• cache.purge(“ProductCode”, “1234”) or
or cache.purge(“obj”, “ProductDetails”, “ProductCode”, “1234”);
• cache.purge(“CategoryId”, getProductByCode(“1234”).getCategories);

ar
m
is
br
hy

CONFIDENTIAL 77
PAGE FRAGMENT CACHING

om
t.c
ar
m
is
br
hy

CONFIDENTIAL 78
PAGE FRAGMENT CACHING

om
t.c
ar
m
is
br
hy

CONFIDENTIAL 79
PAGE FRAGMENT CACHING

om
t.c
ar
m
is
br
hy

CONFIDENTIAL 80
PAGE FRAGMENT CACHING

om
t.c
ar
m
is
br
hy

CONFIDENTIAL 81
om
t.c
ar
PAGE FRAGMENT CACHING

m
VARNISH
is
br
hy

CONFIDENTIAL 82
USING VARNISH

om
Hybris Cache
Caching option #2

t.c
CustomTags

ar
BrowserCache CacheStorage Hybris testcache
/testcache
HTTP/
Varnish ESI

m
HTTPS
80/443
User Varnish key=1_3_
MongoDB

is
/cache/get?key=1_3_
br Cache data
provider
hy

CONFIDENTIAL 83
USING VARNISH

om
doStartTag() doEndTag()
<CACHE:CACHED

t.c
Something between the tags
KEY1= abc TTL= 6" Let s say </CACHE:CACHED>
productId=13
KEY2= ${productId} >

ar
1 e=MongoDBCache.get( abc_13 ) 1 e=MongoDBCache.put( abc_13 , body )

m
2 Check e.TTL: Stale? Remove! 2 e=MongoDBCache.set( abc_13 , TTL , 6))

is
3 If e=null (not in cache): Do nothing.
br 2 calculate minTTL (prevTTL, TTL)

If e!=null (in cache): return ESI TAG: 3 Response.http.X-VarnishCache: minTTL
<esi:include <esi:include
hy
src= /cache/get?key=abc_13"/> src= /cache/get?key=abc_13"/>

CONFIDENTIAL 84
USING NGINX+MEMCACHED

om
t.c
<ESI:include src="/cache/get?key=XXXX"/>

ar
m
is
br
hy

CONFIDENTIAL 85
om
t.c
ar
PAGE FRAGMENT CACHING

m
NGINX
is
br
hy

CONFIDENTIAL 86
USING NGINX+MEMCACHED

om
t.c
Hybris Cache
Caching option #3 See below for details

ar
CustomTags

BrowserCache CacheStorage Hybris
/testcache
HTTP/

m
HTTPS NGINX SSI
80/443
User NGINX memcached
key=1_3_

is
br
hy

CONFIDENTIAL 87
USING NGINX+MEMCACHED

om

t.c

ar
m
is
br
hy

CONFIDENTIAL 88
USING NGINX+MEMCACHED

om
t.c
<--# include file="/cache/get?key=XXXX"/>

ar
m
is
br
hy

CONFIDENTIAL 89
om
t.c
ar
EXPERIMENTS

m
PDF REPORTS
is
br
hy

CONFIDENTIAL 90
GENERATING OF PDF REPORTS

om
Scribus

t.c
template

OR Data

ar
MS Word
template

m
OR Final PDF

is
MS Excel
template PDF Template
br
OR
hy
MS Visio
template

CONFIDENTIAL 91
PDF TEMPLATES

om
“Free” “Commercial”

t.c
1. PDFBox 1. iText
Placeholders are fixed 2. (X,Y) 2. Fields (Acroform)

ar
3. XML definitions of
placeholders

m
is ?
Placeholders aren’t
br
fixed
hy

CONFIDENTIAL 92
PDF

om
t.c
ar
m
is
br
hy

CONFIDENTIAL 93
NOT FIXED PLACEHOLDERS

om
t.c
ar
m
is
br
hy

CONFIDENTIAL 94
NOT FIXED PLACEHOLDERS

om
DOC/XLS
Template
doc/xls pdf

t.c
1 Apache POI UNOCONV PDF IS READY
Data

ar
m
is
HTML
Template
br HTML pdf
2 Script
phantomjs
rasterize.js
PDF IS READY
hy
Data

CONFIDENTIAL 95
NOT FIXED PLACEHOLDERS

om
t.c
ar
PDF
Template
pdf
3

m
Custom PDF merger PDF IS READY
Data

is
br
hy

CONFIDENTIAL 96
CHALLENGES

om

t.c


ar

m

is
• br
hy


CONFIDENTIAL 97
HOW IT WORKS

om
ARRAY X ARRAY Y ARRAY Z
#1 #2 #3 #1 #2 #1 #2

t.c
{ T H E - C L I E N T - N A M E }
When shorter

R A U F A L I E V

ar
When longer

R A U F A L I E V V E L I E V I C H

m
“{” -> “R”

is
“THE” -> “AUF”
“-” -> ” “
br
“CLIENT” -> “ALIEV “
“-” -> ” “
hy
“NAME” -> ” “
“}” -> ” “

CONFIDENTIAL 98
LIMITATIONS

om

t.c

ar
HTML RENDERING IS A BEST OPTION? Possibly yes.

m
HTML
is HTML pdf
Template
br
2 Script
phantomjs
PDF IS READY
hy
rasterize.js
Data

CONFIDENTIAL 99