GithubHelp home page GithubHelp logo

dynamodbcachepsr6's Introduction

dynamodbcachepsr6's People

Contributors

clemherreman avatar rikudousage avatar shadowhand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dynamodbcachepsr6's Issues

Add ability to set SK and namespace

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.

AsyncAws errors are not caught

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();
}

Version 2.0.0 doesn't work

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;

Deprecated conversion from float to int

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

Long cache keys are not truncated

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.