Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Caching cleared up with PSR-6 at Laravel Barcelona

Caching cleared up with PSR-6 at Laravel Barcelona

In this talk we will explain what PSR-6 is, why it is designed like it is, and how to use it. From the provided interfaces, the virtual package on Packagist.org, to the implementations available. Everything will be explained for both beginners and more experienced developers. We will dive into implementations, cache stampede protection, all using libraries we can find on Packagist.org. We will also show how to start using it today in our current applications by using adapters. The entire talk will be accompanied with code samples and live demos, showing both working and failing caching systems.

Audience feedback can be found here: http://www.meetup.com/Laravel-Barcelona/events/230894870/

Hannes Van De Vreken

June 20, 2016
Tweet

More Decks by Hannes Van De Vreken

Other Decks in Technology

Transcript

  1. "

  2. WHAT IS CACHING - EXAMPLES • HTTP Request • Slow

    DB call • Process image/zip/…
  3. APPLICATION CACHING IN 2015 Frameworks & cache libs have their

    own: - interfaces - support for caching systems
  4. APPLICATION CACHING IN 2015 If no adapter available - Write

    your own - Store in different cache stores
  5. INTRODUCING PSR-6 Don’t instantiate your own Items. $item = $pool->getItem(‘key’)

    ->set($value) ->expiresAfter(3600); $pool->save($item);
  6. INTRODUCING PSR-6 Cache features: - Stampede protection - Taggable cache

    $item->addTags(['cat-1']); $pool->clearTags(['cat-1']);
  7. INTRODUCING PSR-6 Cache features: - Stampede protection - Taggable cache

    - Hierarchical cache $pool->delete('tree/*');
  8. START USING IT - UPGRADE Start using PSR-6 enabled libraries

    with adapters for current FW’s implementation.