// Performs conditional get request for the given item.Key and item.Casid.
//
// This is an extension to memcache protocol, so it isn't supported
// by the original memcache server.
//
// Fills item.Value, item.Flags and item.Casid only on cache hit and only
// if the given casid doesn't match the casid on the server, i.e. if the server
// contains new value for the given key.
//
// Returns ErrCacheMiss on cache miss.
// Returns ErrNotModified if the corresponding item on the server has
// the same casid (i.e. the item wasn't modified).
//
// Client.Cget() is intended for reducing network bandwidth consumption
// in multi-level caches. It is modelled after HTTP cache validation approach
// with entity tags - see
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 .
Performs conditional get request for the given item.Key and item.Casid.

This is an extension to memcache protocol, so it isn't supported
by the original memcache server.

Fills item.Value, item.Flags and item.Casid only on cache hit and only
if the given casid doesn't match the casid on the server, i.e. if the server
contains new value for the given key.

Returns ErrCacheMiss on cache miss.
Returns ErrNotModified if the corresponding item on the server has
the same casid .

Client.Cget() is intended for reducing network bandwidth consumption
in multi-level caches.
// Performs conditional get request for the given item . Key and item . Casid . // // This is an extension to memcache protocol so it isn ' t supported // by the original memcache server . // // Fills item . Value item . Flags and item . Casid only on cache hit and only // if the given casid doesn ' t match the casid on the server i . e . if the server // contains new value for the given key . // // Returns ErrCacheMiss on cache miss . // Returns ErrNotModified if the corresponding item on the server has // the same casid ( i . e . the item wasn ' t modified ) . // // Client . Cget () is intended for reducing network bandwidth consumption // in multi - level caches . It is modelled after HTTP cache validation approach // with entity tags - see // http : // www . w3 . org / Protocols / rfc2616 / rfc2616 - sec3 . html#sec3 . 11 .
func (c *Client) Cget(item *Item) error {
	if !validateKey(item.Key) {
		return ErrMalformedKey
	}
	var t taskCget
	t.item = item
	if err := c.do(&t); err != nil {
		return err
	}
	if t.notModified {
		return ErrNotModified
	}
	if !t.found {
		return ErrCacheMiss
	}
	return nil
}
func ( c * Client ) Cget ( item * Item ) error { if ! validateKey ( item . Key ) { return ErrMalformedKey } var t taskCget t . item = item if err := c . do ( & t ) ; err != nil { return err } if t . notModified { return ErrNotModified } if ! t . found { return ErrCacheMiss } return nil }
Performs conditional get request for the given item.Key and item.Casid.
Performs conditional get request for the given item . Key and item . Casid .