Giter Site home page Giter Site logo

psr7-cache's People

Contributors

micheh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

psr7-cache's Issues

Warn about PHP sessions in documentation

This library works like a charm but there was an issue that kept me hitting a wall. It'd be nice if it was mentioned somewhere in the README file.

PHP session handler generates its own headers. The exact ones depend on the session.cache_limiter directive. Its default value is nocache and that means you get:

Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache

This interferes completely with \Micheh\Cache\CacheUtil::withCache(). Only Cache-Control finally gets the value set by this method. It's also not obvious at first sight because these extra headers are set by PHP core and are invisible for PSR-7 implementations (at least the one I'm using).

It's not necessarily the library's fault but it can lead you to wonder why it isn't working. If you want to cache responses from session based applications you need to set session.cache_limiter to something that's not the default, e.g.:

ini_set('session.cache_limiter', 'public');

Reference can be found at session_cache_limiter() manual page.

Conditional PUT, PATCH and DELETE

Hi, thanks for this library, it is a real time saver. Here is an feature request.

I am using psr7-cache in couple of API projects to provide caching based on ETag and Last-Modified headers. I would like to use it also for conditional PUT, PATCH and DELETE methods.

This can be done by adding support for the two currently missing If-Match and If-Unmodified-Since headers which are described in RFC7232.

Roadmap for version 1.0

This library looks pretty solid ๐Ÿ˜ƒ๐Ÿ‘

I was wondering how come this isn't at 1.0 yet?

Presumable it's stable? And it appears to be very complete.

The only thing I'd consider changing myself is type-hinting everything for modern PHP - is that something you're interested in?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.