Showing posts with label cache. Show all posts
Showing posts with label cache. Show all posts

2013/11/13

Devoxx 2013: HTTP Caching in Practice

Xavier Coulon
types of cache:
  • local cache
  • proxy cache
  • gateway cache
  • (app cache -- custom built in the app)
http1.1 caching GET requests
  • expiration Last-Modified + Expires headers
  • If-Modified-Since header -> 304 not modified
  • ETag header
  • If-Match & 412 Precondition failed.
prevent inconsistencies: use explicit directives
  • Cache-Control
    • request header: no-cache, max-age, no-store, max-stale, min-fresh, no-transform & only ..
    • response: public, private, no-cache, proxy-revalidate, max-age,...
  • pragma header, request & response: no-cache: only for http 1.0 backwards compatiblity.
  • Refresh button in brower adds Cache-Control and Pragma headers to request. (not in Ajax requests!
java helpers:
  • Servlet Filter
  • JAX-RS 2.0: interceptors: Ajax-specific (e.g. add ETag + send Status.NOT_MODIFIED)
  • testing:
    • Arquillian (+ REST extension)
    • REST-assured
Https:
  • proxy caching doesn't work
  • decide on using http for static resources...
caching strategy:
  • static content:
    • max cache usage
    • enable gateway caching: Cache-Control: public, max-age
  • dynamic content:
    • timeout or ETag
RFC 2616 spec (http 1.1): http://www.ietf.org/rfc/rfc2616.txt

2011/11/15

Devoxx11: Real-world deep-dive into Infinispan - the open source data grid platform


Sanne Grinovero, Pete Muir and Mircea Markus
Infinispan details
  • developed & provided by JBoss
  • Open Source license
  • distributed, in-memory data structure
  • High Available: configuration options depending on your safety / performance considerations
    • Total replication
    • Partial replication ("distribution mode")
  • Elastic:
    • easy to scale up / down
    • deal with node stops / crashes
    • accept additional nodes
    • managed through JGroups
Capabilities:
  • Transactions
  • Map / Reduce
  • Query
  • JMX access
Two access modes to inifinispan:
  • embedded mode: in the JVM
  • client / server mode: different protocols supported:
    • REST
    • memcached
    • hotrod
Possible setups:
  • local cache: Simple Map-like interface, with advanced cache-features (eviction, etc.)
  • cluster cache: all caches are kept in sync between JVM's, the developer is responsible for accessing the persistence layer (DB)
  • grid cache: the cache itself handles the persisting of the data to the DB.
JGroups
  • reliable cluster communication
  • developed by JBoss, and used by Infinispan
  • Node / cluster config (incl. auto-discover setup)
  • focus on performance: e.g. UDP, but with reliability handled by JGroups
  • support for reliable multicast messages