doctrine / couchdb-client

CouchDB Client library
MIT License
122 stars 68 forks source link

Make use of HTTP validation header #9

Open e42sh opened 11 years ago

e42sh commented 11 years ago

Currently each requests send to couchdb lacks of a etag validation header. This forces couchdb to regenerate a new response instead of sending only a header back. If we have the possibility to of sending such Requests, we could gain performance and throughput on the php application, couchdb and network usage).

If we could send validation header in the HTTP request, couchdb would send a HTTP 304 Not Modified response back. Such responses would also be very helpful when using a gateway cache (e.g. varnish) infront of couchdb.

Something we would need here, is the possibility to

Then a wrapper, like the LoggingClient, could be used to either put it into a local cache like APC or Memcached or just proxy the header to the client.

What do you think @beberlei?

Regards, Martin

h4cc commented 9 years ago

Such a feature should be very usable :+1: This should be implemented in a CachingClient using 'doctrine/cache' as a caching backend IMHO.

beberlei commented 8 years ago

Indeed sounds useful, questioning if it makes sense to use another backend to Cache, but it would work with ArrayCache or not? To avoid doing the same CouchDB requests in the same PHP request.