Kevinrob / guzzle-cache-middleware

A HTTP Cache for Guzzle 6. It's a simple Middleware to be added in the HandlerStack.
MIT License
414 stars 77 forks source link

Write a good documentation #42

Open Kevinrob opened 8 years ago

andrefelipe commented 8 years ago

Hi Kevin, thanks for the library, I am using in production just fine!

When you have time, could you write an example on how to implement the Flysystem cache? I tried but couldn't figure out how. I am new into this.

Thanks again! BTW I have you referenced here in Orchestrate library https://github.com/andrefelipe/orchestrate-php#cache-middleware

Kevinrob commented 8 years ago

@andrefelipe Hi, thank you for using it! I will do that ASAP ;)

Raffaello commented 8 years ago

Hi,

can I even point that the example given for the public cache seems wrong?

the code example should use the PublicCacheStrategy instead is using like the private one PrivateCacheStrategy.

Or what's the diffrerence between PrivateCacheStrategy and Public One? (anyway it is enough to read the comment in the code :)

thank you.

Kevinrob commented 8 years ago

Hi @Raffaello, you're right!

The difference is about privacy and cache headers. Public cache will not cache something marked as Cache-Control: private. One good explication here.

Kevinrob commented 8 years ago

@andrefelipe I have added an example for Flysystem in the README. Sorry for taking some time to do it!

andrefelipe commented 8 years ago

Hey @Kevinrob thank you very much! Interesting to see the possibility to cache in S3 buckets. Not sure the IO delay will pay off, but great to have the possibility.

bogdanghervan commented 8 years ago

Good job on this beautifully designed package!

After a bit of poking around I found out that the caching strategy I really need is GreedyCacheStrategy and I think this should be documented as well in the README. In fact, I composer-required this package expecting it to do just that - cache every Guzzle request regardless of any cache-related recommendation in the response.

My use case is this: I'm writing a Goutte-based web scraper and I need to cache Guzzle responses for a reasonable amount of time.

afoeder commented 7 years ago

@bogdanghervan : #80