SlideShare a Scribd company logo
Cache bonanza
Harald Schult Ulriksen
@hsulriksen
http://aurum.no
HTTP Cache Output cache
Application
cache
RFC 7234 - HTTP/1.1 Caching
RFC 7234 - HTTP/1.1 Caching
A stored response can be considered fresh
if the response can be reused without validation
RFC 7234 - HTTP/1.1 Caching
Although caching is an entirely OPTIONAL feature of HTTP, it can be
assumed that reusing a cached response is desirable and that such
reuse is the default behavior when no requirement or local
configuration prevents it. Therefore, HTTP cache requirements are
focused on preventing a cache from either storing a non-reusable
response or reusing a stored response inappropriately, rather than
mandating that caches always store and reuse particular responses.
RFC 7234 - HTTP/1.1 Caching
Freshness
• s-max-age
• max age
• expires
• heuristics
RFC 7234 - HTTP/1.1 Caching
Freshness
• s-max-age
• max age
• expires
• heuristics
Last modified Last requested Now
Tid
RFC 7234 - HTTP/1.1 Caching
Freshness
• s-max-age
• max age
• expires
• heuristics
Validation - RFC 7232
• Etag
• Last-Modified
• If-none-match
• If-modified-since
RFC 7234 - HTTP/1.1 Caching
Linker
• RFC 7234 - https://tools.ietf.org/html/rfc7234
• RFC 7232 - https://tools.ietf.org/html/rfc7234
• Mark Nottinham - https://www.mnot.net/cache_docs
• Darrel Miller - http://bizcoder.com/caching-is-hard-draw-me-a-picture
• Jesse Wilson – https://publicobject.com/2015/03/26/how-do-http-
caching-heuristics-work
Application cache
• Local cache
• Redis
• Redis with msgpack
• Distributed layered cache
• With synchronization
• Fun with Redis
Local cache
Demo
Remote cache
Remote cache
Remote cache
Redis
• http://redis.io
• Key value store + data structures
• By Salvatore Sanfilippo / @antirez
• Ansi C
• Single threaded
• Lua in server
• Microsoft research port to windows – nuget redis-64
• On Azure, AWS og Google cloud.
Demo
In production
Layered distributed cache
Application Local cache Remote cache Slow thing
Demo
Pub-sub
1
2
3
4
1.Store data
2.Send publish notification
3.Publish notification
4.Get data
Demo
In production
In production
Other datastructures in Redis
Search for «An introduction to data types and abstractions»
• Key/Value
• Lists
• Hashsets
• Set
• Sorted set
• Hyperloglog
• Geospatial
Lua script
Atomisk operasjon. Ingen rollback. Kan lastes opp til server og
kalles basert på hash.
Add now-playing
Read

More Related Content

What's hot

Red Hat Storage Day Dallas - Storage for OpenShift Containers
Red Hat Storage Day Dallas - Storage for OpenShift Containers Red Hat Storage Day Dallas - Storage for OpenShift Containers
Red Hat Storage Day Dallas - Storage for OpenShift Containers
Red_Hat_Storage
 
Red Hat Storage Day Seattle: Stretching A Gluster Cluster for Resilient Messa...
Red Hat Storage Day Seattle: Stretching A Gluster Cluster for Resilient Messa...Red Hat Storage Day Seattle: Stretching A Gluster Cluster for Resilient Messa...
Red Hat Storage Day Seattle: Stretching A Gluster Cluster for Resilient Messa...
Red_Hat_Storage
 
RedisDay London 2018 - Layered Orchestration & Redis Enterprise for fun and p...
RedisDay London 2018 - Layered Orchestration & Redis Enterprise for fun and p...RedisDay London 2018 - Layered Orchestration & Redis Enterprise for fun and p...
RedisDay London 2018 - Layered Orchestration & Redis Enterprise for fun and p...
Redis Labs
 
Red hat storage objects, containers and Beyond!
Red hat storage objects, containers and Beyond!Red hat storage objects, containers and Beyond!
Red hat storage objects, containers and Beyond!
andreas kuncoro
 
Redis Replication
Redis ReplicationRedis Replication
Redis Replication
Ismaeel Enjreny
 
Cache Tiering and Erasure Coding
Cache Tiering and Erasure CodingCache Tiering and Erasure Coding
Cache Tiering and Erasure Coding
Shinobu Kinjo
 
Red Hat Storage Roadmap
Red Hat Storage RoadmapRed Hat Storage Roadmap
Red Hat Storage Roadmap
Colleen Corrice
 
Configuration Management vs. Container Automation
Configuration Management vs. Container AutomationConfiguration Management vs. Container Automation
Configuration Management vs. Container Automation
inovex GmbH
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
TO THE NEW | Technology
 
Reliable Storage for High Availability, Disaster Recovery, Clouds and Contain...
Reliable Storage for High Availability, Disaster Recovery, Clouds and Contain...Reliable Storage for High Availability, Disaster Recovery, Clouds and Contain...
Reliable Storage for High Availability, Disaster Recovery, Clouds and Contain...
Celia Chase
 
Red Hat Storage Day Dallas - Defiance of the Appliance
Red Hat Storage Day Dallas - Defiance of the Appliance Red Hat Storage Day Dallas - Defiance of the Appliance
Red Hat Storage Day Dallas - Defiance of the Appliance
Red_Hat_Storage
 
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFSHadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Erik Krogen
 
Into the cold - Object Storage in SWITCHengines
Into the cold - Object Storage in SWITCHenginesInto the cold - Object Storage in SWITCHengines
Into the cold - Object Storage in SWITCHengines
Simon Leinen
 
Adventures in Research
Adventures in ResearchAdventures in Research
Adventures in Research
NETWAYS
 
Hadoop Meetup Jan 2019 - Hadoop Encryption
Hadoop Meetup Jan 2019 - Hadoop EncryptionHadoop Meetup Jan 2019 - Hadoop Encryption
Hadoop Meetup Jan 2019 - Hadoop Encryption
Erik Krogen
 
Architecting Ceph Solutions
Architecting Ceph SolutionsArchitecting Ceph Solutions
Architecting Ceph Solutions
Red_Hat_Storage
 
Ceph and Openstack in a Nutshell
Ceph and Openstack in a NutshellCeph and Openstack in a Nutshell
Ceph and Openstack in a Nutshell
Karan Singh
 
Disk health prediction for Ceph
Disk health prediction for CephDisk health prediction for Ceph
Disk health prediction for Ceph
Ceph Community
 
RedisDay London 2018 - Redis & BioCatch Catching the Bad Guys in Action with ...
RedisDay London 2018 - Redis & BioCatch Catching the Bad Guys in Action with ...RedisDay London 2018 - Redis & BioCatch Catching the Bad Guys in Action with ...
RedisDay London 2018 - Redis & BioCatch Catching the Bad Guys in Action with ...
Redis Labs
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer Spotlight
Colleen Corrice
 

What's hot (20)

Red Hat Storage Day Dallas - Storage for OpenShift Containers
Red Hat Storage Day Dallas - Storage for OpenShift Containers Red Hat Storage Day Dallas - Storage for OpenShift Containers
Red Hat Storage Day Dallas - Storage for OpenShift Containers
 
Red Hat Storage Day Seattle: Stretching A Gluster Cluster for Resilient Messa...
Red Hat Storage Day Seattle: Stretching A Gluster Cluster for Resilient Messa...Red Hat Storage Day Seattle: Stretching A Gluster Cluster for Resilient Messa...
Red Hat Storage Day Seattle: Stretching A Gluster Cluster for Resilient Messa...
 
RedisDay London 2018 - Layered Orchestration & Redis Enterprise for fun and p...
RedisDay London 2018 - Layered Orchestration & Redis Enterprise for fun and p...RedisDay London 2018 - Layered Orchestration & Redis Enterprise for fun and p...
RedisDay London 2018 - Layered Orchestration & Redis Enterprise for fun and p...
 
Red hat storage objects, containers and Beyond!
Red hat storage objects, containers and Beyond!Red hat storage objects, containers and Beyond!
Red hat storage objects, containers and Beyond!
 
Redis Replication
Redis ReplicationRedis Replication
Redis Replication
 
Cache Tiering and Erasure Coding
Cache Tiering and Erasure CodingCache Tiering and Erasure Coding
Cache Tiering and Erasure Coding
 
Red Hat Storage Roadmap
Red Hat Storage RoadmapRed Hat Storage Roadmap
Red Hat Storage Roadmap
 
Configuration Management vs. Container Automation
Configuration Management vs. Container AutomationConfiguration Management vs. Container Automation
Configuration Management vs. Container Automation
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Reliable Storage for High Availability, Disaster Recovery, Clouds and Contain...
Reliable Storage for High Availability, Disaster Recovery, Clouds and Contain...Reliable Storage for High Availability, Disaster Recovery, Clouds and Contain...
Reliable Storage for High Availability, Disaster Recovery, Clouds and Contain...
 
Red Hat Storage Day Dallas - Defiance of the Appliance
Red Hat Storage Day Dallas - Defiance of the Appliance Red Hat Storage Day Dallas - Defiance of the Appliance
Red Hat Storage Day Dallas - Defiance of the Appliance
 
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFSHadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
 
Into the cold - Object Storage in SWITCHengines
Into the cold - Object Storage in SWITCHenginesInto the cold - Object Storage in SWITCHengines
Into the cold - Object Storage in SWITCHengines
 
Adventures in Research
Adventures in ResearchAdventures in Research
Adventures in Research
 
Hadoop Meetup Jan 2019 - Hadoop Encryption
Hadoop Meetup Jan 2019 - Hadoop EncryptionHadoop Meetup Jan 2019 - Hadoop Encryption
Hadoop Meetup Jan 2019 - Hadoop Encryption
 
Architecting Ceph Solutions
Architecting Ceph SolutionsArchitecting Ceph Solutions
Architecting Ceph Solutions
 
Ceph and Openstack in a Nutshell
Ceph and Openstack in a NutshellCeph and Openstack in a Nutshell
Ceph and Openstack in a Nutshell
 
Disk health prediction for Ceph
Disk health prediction for CephDisk health prediction for Ceph
Disk health prediction for Ceph
 
RedisDay London 2018 - Redis & BioCatch Catching the Bad Guys in Action with ...
RedisDay London 2018 - Redis & BioCatch Catching the Bad Guys in Action with ...RedisDay London 2018 - Redis & BioCatch Catching the Bad Guys in Action with ...
RedisDay London 2018 - Redis & BioCatch Catching the Bad Guys in Action with ...
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer Spotlight
 

Similar to Cache bonanza

cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cache
Marc Cortinas Val
 
Accelerating Rails with edge caching
Accelerating Rails with edge cachingAccelerating Rails with edge caching
Accelerating Rails with edge caching
Michael May
 
The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010Phil Pursglove
 
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
IrishDev.com
 
Rails Caching: Secrets From the Edge
Rails Caching: Secrets From the EdgeRails Caching: Secrets From the Edge
Rails Caching: Secrets From the Edge
Fastly
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the Edge
Michael May
 
The Need For Speed - NEBytes
The Need For Speed - NEBytesThe Need For Speed - NEBytes
The Need For Speed - NEBytesPhil Pursglove
 
Content Caching with NGINX and NGINX Plus
Content Caching with NGINX and NGINX PlusContent Caching with NGINX and NGINX Plus
Content Caching with NGINX and NGINX Plus
Kevin Jones
 
Hadoop in the cloud – The what, why and how from the experts
Hadoop in the cloud – The what, why and how from the expertsHadoop in the cloud – The what, why and how from the experts
Hadoop in the cloud – The what, why and how from the experts
DataWorks Summit
 
Caching on the web
Caching on the webCaching on the web
Caching on the web
Jean Carlo Emer
 
Solr 4
Solr 4Solr 4
Solr 4
Erik Hatcher
 
Red Hat Storage Day New York - What's New in Red Hat Ceph Storage
Red Hat Storage Day New York - What's New in Red Hat Ceph StorageRed Hat Storage Day New York - What's New in Red Hat Ceph Storage
Red Hat Storage Day New York - What's New in Red Hat Ceph Storage
Red_Hat_Storage
 
(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco
Angel Borroy López
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
ITviec
 
Managing storage on Prem and in Cloud
Managing storage on Prem and in CloudManaging storage on Prem and in Cloud
Managing storage on Prem and in Cloud
Howard Marks
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonPhil Pursglove
 
Building & Testing Scalable Rails Applications
Building & Testing Scalable Rails ApplicationsBuilding & Testing Scalable Rails Applications
Building & Testing Scalable Rails Applicationsevilmike
 
Open vStorage Road show 2015 Q1
Open vStorage Road show 2015 Q1Open vStorage Road show 2015 Q1
Open vStorage Road show 2015 Q1
wim_provoost
 

Similar to Cache bonanza (20)

cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cache
 
Accelerating Rails with edge caching
Accelerating Rails with edge cachingAccelerating Rails with edge caching
Accelerating Rails with edge caching
 
The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010
 
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
 
Rails Caching: Secrets From the Edge
Rails Caching: Secrets From the EdgeRails Caching: Secrets From the Edge
Rails Caching: Secrets From the Edge
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the Edge
 
The Need For Speed - NEBytes
The Need For Speed - NEBytesThe Need For Speed - NEBytes
The Need For Speed - NEBytes
 
Content Caching with NGINX and NGINX Plus
Content Caching with NGINX and NGINX PlusContent Caching with NGINX and NGINX Plus
Content Caching with NGINX and NGINX Plus
 
Hadoop in the cloud – The what, why and how from the experts
Hadoop in the cloud – The what, why and how from the expertsHadoop in the cloud – The what, why and how from the experts
Hadoop in the cloud – The what, why and how from the experts
 
Caching on the web
Caching on the webCaching on the web
Caching on the web
 
Solr 4
Solr 4Solr 4
Solr 4
 
Velocity - Edge UG
Velocity - Edge UGVelocity - Edge UG
Velocity - Edge UG
 
Red Hat Storage Day New York - What's New in Red Hat Ceph Storage
Red Hat Storage Day New York - What's New in Red Hat Ceph StorageRed Hat Storage Day New York - What's New in Red Hat Ceph Storage
Red Hat Storage Day New York - What's New in Red Hat Ceph Storage
 
Varnish intro
Varnish introVarnish intro
Varnish intro
 
(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
 
Managing storage on Prem and in Cloud
Managing storage on Prem and in CloudManaging storage on Prem and in Cloud
Managing storage on Prem and in Cloud
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG London
 
Building & Testing Scalable Rails Applications
Building & Testing Scalable Rails ApplicationsBuilding & Testing Scalable Rails Applications
Building & Testing Scalable Rails Applications
 
Open vStorage Road show 2015 Q1
Open vStorage Road show 2015 Q1Open vStorage Road show 2015 Q1
Open vStorage Road show 2015 Q1
 

Recently uploaded

一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
ukgaet
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
oz8q3jxlp
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
yhkoc
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
g4dpvqap0
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
AbhimanyuSinha9
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
2023240532
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
ArpitMalhotra16
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
一比一原版(YU毕业证)约克大学毕业证成绩单
一比一原版(YU毕业证)约克大学毕业证成绩单一比一原版(YU毕业证)约克大学毕业证成绩单
一比一原版(YU毕业证)约克大学毕业证成绩单
enxupq
 

Recently uploaded (20)

一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
一比一原版(YU毕业证)约克大学毕业证成绩单
一比一原版(YU毕业证)约克大学毕业证成绩单一比一原版(YU毕业证)约克大学毕业证成绩单
一比一原版(YU毕业证)约克大学毕业证成绩单
 

Cache bonanza

  • 1. Cache bonanza Harald Schult Ulriksen @hsulriksen http://aurum.no
  • 2.
  • 3. HTTP Cache Output cache Application cache
  • 4. RFC 7234 - HTTP/1.1 Caching
  • 5. RFC 7234 - HTTP/1.1 Caching A stored response can be considered fresh if the response can be reused without validation
  • 6. RFC 7234 - HTTP/1.1 Caching Although caching is an entirely OPTIONAL feature of HTTP, it can be assumed that reusing a cached response is desirable and that such reuse is the default behavior when no requirement or local configuration prevents it. Therefore, HTTP cache requirements are focused on preventing a cache from either storing a non-reusable response or reusing a stored response inappropriately, rather than mandating that caches always store and reuse particular responses.
  • 7. RFC 7234 - HTTP/1.1 Caching Freshness • s-max-age • max age • expires • heuristics
  • 8. RFC 7234 - HTTP/1.1 Caching Freshness • s-max-age • max age • expires • heuristics Last modified Last requested Now Tid
  • 9. RFC 7234 - HTTP/1.1 Caching Freshness • s-max-age • max age • expires • heuristics Validation - RFC 7232 • Etag • Last-Modified • If-none-match • If-modified-since
  • 10. RFC 7234 - HTTP/1.1 Caching Linker • RFC 7234 - https://tools.ietf.org/html/rfc7234 • RFC 7232 - https://tools.ietf.org/html/rfc7234 • Mark Nottinham - https://www.mnot.net/cache_docs • Darrel Miller - http://bizcoder.com/caching-is-hard-draw-me-a-picture • Jesse Wilson – https://publicobject.com/2015/03/26/how-do-http- caching-heuristics-work
  • 11. Application cache • Local cache • Redis • Redis with msgpack • Distributed layered cache • With synchronization • Fun with Redis
  • 13. Demo
  • 17. Redis • http://redis.io • Key value store + data structures • By Salvatore Sanfilippo / @antirez • Ansi C • Single threaded • Lua in server • Microsoft research port to windows – nuget redis-64 • On Azure, AWS og Google cloud.
  • 18. Demo
  • 20. Layered distributed cache Application Local cache Remote cache Slow thing
  • 21. Demo
  • 22. Pub-sub 1 2 3 4 1.Store data 2.Send publish notification 3.Publish notification 4.Get data
  • 23. Demo
  • 26. Other datastructures in Redis Search for «An introduction to data types and abstractions» • Key/Value • Lists • Hashsets • Set • Sorted set • Hyperloglog • Geospatial
  • 27. Lua script Atomisk operasjon. Ingen rollback. Kan lastes opp til server og kalles basert på hash.
  • 29. Read

Editor's Notes

  1. Blackfriday.
  2. Black Friday. Skatteetaten. Valg Før vi fortsetter – det er mange patterns, og mye å tenke på for å skalere. Cache er bare ett av dem.
  3. Når man snakker om cache så er det mange som tenker på CDN. Idag skal, vi la CDN være CDN, og gå utifra at vi hoster bilder og annet statisk innhold hos en CDN, så kan vi se på cache rundt de delene av tjenesten som leverer data. Hvis vi ser på veien fra en klient til et api så er det overordnet 3 cache lag, http cache – gjerne client side, en eller annen output cache som står rett på tjenesten men etter at data er sendt, også har vi application cache. For de som synes CPU cache er spennende, så må jeg skuffe dere. Jeg har lyst til å snakke om HTTP cache pga. etags og last modified header. Har vi orden på dette og en god applikasjonscache kommer vi usedvanlig langt.
  4. Målet med HTTP cache er å merkbart forbedre ytelsen ved å gjenbruke svar fra en tidligere forespørsel. Samtidig er det viktig at man opprettholder semantikken i protokollen, med GET/PUT/DELETE etc. Caching er valgfritt, men man kan gå utifra at gjenbruk av et tidligere svar er vanlig oppførsel.
  5. Dette betyr at det er to ting som er viktig for å kunne avgjøre om en lagret respons kan brukes, det er om den er kan betraktes som gyldig, eller om den må valideres. Når vi vet at caching kan sees på som standard, og at gyldighet og validering er de viktige tingene, så er er det verdt å legge merke til at RFC 7234 ikke er skrevet som kriterier som skal til for at man skal kunne cache, men hva som skal til for å hindre lagring av responser som ikke kan gjenbrukes, eller gjenbruke en respons på feil grunnlag.
  6. Bruk tid på å la de lese. Time selv. Drikk vann. Så, specen sier ingen ting om at man alltid skal lagre xyz, det er hva vi ikke skal lagre og hva vi ikke kan gjenbruke. Når vi vet at caching kan sees på som standard, og at gyldighet og validering er de viktige tingene, så er er det verdt å legge merke til at
  7. Freshness Når en respons er gyldig, så behøver vi ikke snakke med remote server. Den kan leveres direkte fra cache. Dette er selvfølgelig det mest effektive og det vi ønsker. For at at side skal kunne ansees som fresh vurderes s-max-age, max-age og expires før man evt. prøver å beregne om cache er fresh.
  8. We use the time between last requested at and last modified at to estimate how frequently a document is edited. If a page was modified 5 minutes before the request, it’s assumed to be frequently modified. If it was last modified 5 years before the request, it’s assumed to be infrequently modified. A page is fresh for 10% of that duration: 10% of 5 minutes is 30 seconds; 10% of 5 years is 6 months. A page is considered fresh until that 10% has elapsed since the document was last requested. An example. 100 I mellom last modified og last requested. Ni dager etter ber vi om nytt. Fresh. Levert fra cache. 11 dager etter. Fører til validation request til server .
  9. Validering skjer ved bruk av headere som gjør at man kan få en 304 respons fra server. I tillegg kan validering gjøres ved put og delete, slik at operasjoner kun utføres hvis server state ikke har endret seg i mellomtiden. To headers – last modified – sum av flere deler – og da den som er sist endret. Utfordringen med last modified er at den ikke har høyere oppløsning enn sekund, og derfor i utgangspunktet er å betrakte som en svak validator. Når det gjelder etag er de å anse som sterke, men hvis den ikke er det så MÅ serveren markere den som weak. F.eks hvis man bruker en hashing algoritme som ikke garanterer uniqueness. En server bør sende både etag og last modified. En klient skal sende entity-tag med i validerings request. (med passende if-match eller if-none-match) Bør sende med last modified og if-modified-since If-none-match, må bruke svak godkjenning, brukes hovedsaklig med get requests. Hvis det er en som passer skal server svare med 304 for get eller head. 412 for alle andre metoder. Kan også brukes ved put for å sikre at server ikke har en eksisterende representasjon. Race condition/lost update. If-modified-since Skal ignoreres hvis det er en If-None-Match header med requesten. Klienten bør gjenbruke last-modified fra cachet respons for å få riktig dato (husk å droppe millisekunder på server siden). Hvis server har en dato som er før eller lik last-modified så skal den svare med 304. ------- If-match – etag – pre-condition. Hvis server ikke har denne, 412. Hvis det er state change og resultatet av operasjonen alt er gjort så kan den levere 2XX. Kan ignoreres av cache da den ikke gjelder lagret respons. If-unmodified-since brukes også til å sikre state change på riktig grunnlag. ------
  10. Enkelt og greit, i minne, i context. Kan være så enkelt som et static dictionary. Men kjekt med minnebegrensning, ttl og eviction. Mutability Cache aside pattern. – consistency, priming, eviction. Demo – god tid. Vis interfaces, vis kode.
  11. Bruk god tid. Gå igjennom interfaces, forklar hva vi egentlig ser. Netling
  12. Hvorfor remote cache? Skalering, lastbalansering. Synkronisering. Kalle instanser. Hva skjer når man går over til en remote cache? Vi får 2 problemer - IO og serialisering Husk, minne er lynkjapt.
  13. Er også i clustret versjon med master. Finnes mange løsninger på dette utover redis cluster, twemproxy, monaco, master slave. Sikkerhet, i utgangspunktet vid åpen. Støtter ssl + auth key. En connection til server. Pipelining
  14. Demo Redis – install, run, client, monitor, info Demo prosjekt. Vis kode. Serialisering og implementasjon Single instance Husk å lukke monitor Demo prosjekt many
  15. Implementasjon Demo
  16. Krever kontroll på data. Nok en grunn til at database som integrasjonspunkt mellom applikasjoner er en sikkelig dårlig idé. Etags – last modified! Cache aside, hva skjer når det mangler i all cache og man får mange requests samtidig?
  17. Implementasjon Demo
  18. Key/Value String. Kan gjøre bit operasjoner og INRC DECR (api throtling) Lists Linked list. Kan brukes som kø/log Hashset Lagring av objekter. Kan lønne seg å bruke ett hashset med mange hashes (key) fremfor key/value pairs. Sets Kan gjøre union/intersect m.fl SortedSet Top Score, Sortering i tid, Hyperloglogs Telle forferdelig store ting med lite minne. Omtrentlig nøyakti Geospatial  
  19. Key/Value String. Kan gjøre bit operasjoner og INRC DECR (api throtling) Lists Linked list. Kan brukes som kø/log Hashset Lagring av objekter. Kan lønne seg å bruke ett hashset med mange hashes (key) fremfor key/value pairs. Sets Kan gjøre union/intersect m.fl SortedSet Top Score, Sortering i tid, Hyperloglogs Telle forferdelig store ting med lite minne. Omtrentlig nøyakti Geospatial