8RGSCP LCMJHGPQCEJNMGP JIMGCP VUg`WUY FG KC … · Eih]hUg XY` FUWUbU`& Yb `U fY[]cb XY `U LU`]bU XY
DClass and Varnish Reza Naghibi [email protected] VUG 7 May 2013.
-
Upload
bernardo-stickland -
Category
Documents
-
view
215 -
download
0
Transcript of DClass and Varnish Reza Naghibi [email protected] VUG 7 May 2013.
![Page 2: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/2.jpg)
Agenda
• What is dClass?• Brief history of device detection• Device classification in Varnish using
dClass• Device classification and developers• Apache DeviceMap• The future of dClass
![Page 3: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/3.jpg)
What is dClass?
• dClass is search reversed• Search is discovery, dClass is
classification• dClass indexes searches• Searches are patterns• Patterns represent knowledge• dClass indexes knowledge
![Page 4: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/4.jpg)
How does dClass work?
• dClass uses a handful of performance optimizations
• Algorithms == speed• Memory efficiency == speed• dClass precompiles all regex• dClass breaks out of dead input by walking the
input as it walks the pattern tree• Concise patterns == high performance
![Page 5: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/5.jpg)
History of device detection
• User-Agent header was designed for this• Browsers, screen sizes, network speeds,
and CPU speeds all progressed at ‘relatively’ the same pace
• Mobile devices and tablets changed that• Client fragmentation led to developer
fragmentation
![Page 6: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/6.jpg)
Server side device ‘detection’
• It is not detection, its classification!• The device classes we care most about:
– Smart phones– Tablets– Desktop browsers– Web Crawlers– Feature phones (maybe?)
• Each class has different requirements• Browser version targeting is available (think
IE)
![Page 7: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/7.jpg)
Device ‘detection’ challenges
• Device detection used to be difficult:– Logic was messy and non performant– New devices are released every month
• dClass + Varnish is clean and performant• Apache DeviceMap (formally OpenDDR) and
other commercial offerings stay ontop of releases
• How often do you update your website? That is how often you should update your DDR!
![Page 8: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/8.jpg)
dClass + Varnish
• The solution is completely contained within Varnish• VCL is expressive! Lots of options:
– Send device classification header to backend. Serve different views on same URL and domain.
– Redirect requests to device specific domain or rewrite to device specific URL. Can still have single backend.
– Mix and match
• Upstream caching (CDN) complicates this, may need to use cookies (or just find a better CDN…)
• Varnish can even serve device classification JSON for client side use
![Page 9: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/9.jpg)
dClass + Varnish configuration
Source:https://github.com/TheWeatherChannel/dClass
VCL:https://raw.github.com/TheWeatherChannel/dClass/master/servers/varnish/dclass.vcl
•To update your DDR just use vcl.load and vcl.use in varnishadm (no downtime!)•Apache DeviceMap has monthly DDR updates•Vendors/Admins/SysOps, offer this to your clients!
![Page 10: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/10.jpg)
Device classification + developers
• Device classification will simplify your code• Device classification is just another backend
parameter• It can be completely transparent to the
web stack like load balancing or caching• Projects like dClass and DeviceMap have
made device classification more accessible than ever
![Page 11: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/11.jpg)
Apache DeviceMap
• Was born out of the OpenDDR project• Still in incubator status, so look for big
changes in the upcoming months• Have an issue with a device, tell us!• Contribute!http://incubator.apache.org/devicemap/
![Page 12: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/12.jpg)
dClass and the future
• dClass is a powerful pattern classification engine
• Better classification leads to things like higher order reasoning and richer interactions
• webClass (http://rezsoft.org/webclass)
• Contribute!
![Page 13: DClass and Varnish Reza Naghibi reza.naghibi@yahoo.com VUG 7 May 2013.](https://reader038.fdocuments.net/reader038/viewer/2022110116/5518be13550346a61f8b544f/html5/thumbnails/13.jpg)
Questions?
• I am always available for questions and support– Email: [email protected]– LinkedIn: Reza Naghibi– Twitter: rezaberry