rikudousage / dynamodbcachepsr6 Goto Github PK
View Code? Open in Web Editor NEWPSR-6 and PSR-16 cache implementation using AWS DynamoDB
License: MIT License
PSR-6 and PSR-16 cache implementation using AWS DynamoDB
License: MIT License
I think it would be helpful to have an ability to set SortKey for the table for projects made with single-table design principles.
In this case having prefix (e.g. RIKIDOUCACHE#
or a custom one) would be a super helpful too (RikudouSage/DynamoDbCachePsr6Bundle#6).
Single-table means structure like this:
PK | SK | value | ttl |
---|---|---|---|
RIKIDOUCACHE#key1 | RIKIDOUCACHE#key1 | value1 | 0 |
RIKIDOUCACHE#key2 | RIKIDOUCACHE#key2 | value2 | 0 |
APP#user1 | APP#user1 | username1 |
If this case should be handled by Decorator from RikudouSage/DynamoDbCachePsr6Bundle#7 then it would be helpful to have documented somewhere.
We have been getting a fair number of the following errors:
Unhandled AsyncAws\Core\Exception\Http\NetworkException (0) error: Could not contact remote server.
It seems like these NetworkException
errors should be caught inside of getRawItem
and throw a CacheItemNotFoundException
, as in:
try {
return $item->getItem();
} catch (NetworkException) {
throw new CacheItemNotFoundException();
}
I can't figure out why, but upgrading to version 2.0.0 causes all calls to error with:
Code: ResourceNotFoundException
Message: Cannot do operations on a non-existent table
Nothing about my configuration has changed, other than switching:
- use Aws\DynamoDb\DynamoDbClient;
+ use AsyncAws\DynamoDb\DynamoDbClient;
Getting this error on PHP 8.1
Deprecated: Implicit conversion from float 1638914291.287998 to int loses precision
here
$value = $reflectionExpiry->getValue($cacheItem);
if ($value === null) {
$expiry = null;
} else {
$expiry = new DateTime();
$expiry->setTimestamp($value); ⬅️
}
// @codeCoverageIgnoreStart
When a cache key exceeds 2048 characters, the following error will show up:
Code: ValidationException
Message: One or more parameter values were invalid: Size of hashkey has exceeded the maximum size limit of2048 bytes
Type:
Detail:
The problem is that there is no attempt to restrict/truncate the cache key. As I am unable to control the way that some packages (in this case, Symfony ExpressionLanguage) choose to set keys, errors will eventually occur.
One solution is to truncate the key and attach a hash to prevent collisions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.