https://github.com/activecollab/etag
Tag objects and collections using etag
https://github.com/activecollab/etag
Last synced: about 1 year ago
JSON representation
Tag objects and collections using etag
- Host: GitHub
- URL: https://github.com/activecollab/etag
- Owner: activecollab
- License: mit
- Created: 2015-11-09T08:42:24.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-03-09T08:29:42.000Z (over 2 years ago)
- Last Synced: 2025-03-30T13:03:28.383Z (about 1 year ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Etag Interface
[](https://travis-ci.org/activecollab/etag)
Tag objects and collections using etag, and validate cached values. This package contains only the interface, so actual implementation needs to be implemented in libraries that use it.
`ActiveCollab\Etag\EtagInterface` Interface says it all:
```php
/**
* @package ActiveCollab\Etag
*/
interface EtagInterface
{
/**
* Return true if this state of this object can be tagged and cached on client side.
*
* @return boolean
*/
public function canBeEtagged();
/**
* Return etag.
*
* $visitor_identifier is a way that we identify a particular visitor (different people can use the same browsers
* under the same profile, and share the cache, so we need to address that).
*
* @param string $visitor_identifier
* @param boolean $use_cache
* @return string
*/
public function getEtag($visitor_identifier, $use_cache = true);
/**
* Check if provided etag value matches the current object state.
*
* $visitor_identifier is a way that we identify a particular visitor (different people can use the same browsers
* under the same profile, and share the cache, so we need to address that).
*
* @param string $value
* @param string $visitor_identifier
* @param boolean $use_cache
* @return boolean
*/
public function verifyEtag($value, $visitor_identifier, $use_cache = true);
}
```