GithubHelp home page GithubHelp logo

cache-bundle's Issues

PHP requirement ~5.3

If you want to use or test the bundle with php 7.x, composer will fail with the following error.

- aequasi/cache-bundle 3.0.2 requires php ~5.3 -> your PHP version (7.0.8) does not satisfy that requirement.

Issue with using Symfony 2.0.1 version

I downloaded the latest version but I get this error
I am using Symfony 2.0.1

Call to undefined method Symfony\Component\Config\Definition\Builder\NodeBuilder::append()

Session TTL is not used as shown in example configuration

The example configuration shows that the session TTL value is set as shown:

aequasi_cache:
    session:
        enabled: true
        instance: default
        prefix: "session_"
        ttl: 1800

However, the TTL value specified here is not used, instead the cookie_lifetime value is used from the Symfony framework session configuration.

disable memcache for one or two specific queries

Hello,

I've a great problem: on the one hand I really want and need speed thing up a little bit by using memcache in my symfony2 application. On the other hand I have at least one or two single queries I never want to be cached.

Any idea how to do that?

Memcached options

Is there a way to set memcached options?

The options array in the instances configuration is not defined to contain any values.

Wrong configuration setting for type

I just tested your cache bundl which looks great.
For dev and testing purpose, I need to use the file cache.

On the file Aequasi\Bundle\CacheBundle\DependencyInjection\Configuration.php on line 73 you're setting the available type option:
->values(array('redis', 'file', 'memcached', 'apc'))

After digging into your code, it appears the file option is not available.
Instead we should use php_file or file_system.

I found out that after looking on the services.yml file

It seems that there is other type possibility too:
array, memcache, win_cache, xcache and zend_data.

I didn't test them.

So to correct the issue, it seems the only required action is to update the availble option by setting:
->values(array('redis', 'php_file', 'file_system', 'memcached', 'apc'))
(and maybe more for the others)

Session Cache seems not to work

I used your memcached bundle before and switched to the new cache-bundle. Unfortunatly it seems that the session caching doesn't work like before. It simply doesn't find the sessions in the memcache (we are using elasticcache)

Clearing memcache from sf2 console command

Is it possible to add a command to clear memcache from CLI? I know I can do it with just memcache but it would be nice for our builds to clear routing and doctrine metadata cache without any special privileges to directly contact Memcached.

Multiple Memcached Instances

Anytime I attempt to create multiple memcached instances I am greeted my whitescreens of death.

It doesn't say in the documentation that I can't split things across multiple memcached clusters, so I'm just curious if this is expected behaviour?

Missing the underlying interface of Symfony UrlMatcher

hi,

it seems your cache key generation is overlooking the underlying UrlMatching logic of symfony

protected function matchCollection($pathinfo, RouteCollection $routes)
    {
        foreach ($routes as $name => $route) {
            $compiledRoute = $route->compile();

            // check the static prefix of the URL first. Only use the more expensive preg_match when it matches
            if ('' !== $compiledRoute->getStaticPrefix() && 0 !== strpos($pathinfo, $compiledRoute->getStaticPrefix())) {
                continue;
            }

            if (!preg_match($compiledRoute->getRegex(), $pathinfo, $matches)) {
                continue;
            }

            $hostMatches = array();
            if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) {
                continue;
            }

            // check HTTP method requirement
            if ($req = $route->getRequirement('_method')) {
                // HEAD and GET are equivalent as per RFC
                if ('HEAD' === $method = $this->context->getMethod()) {
                    $method = 'GET';
                }

                if (!in_array($method, $req = explode('|', strtoupper($req)))) {
                    $this->allow = array_merge($this->allow, $req);

                    continue;
                }
            }

            $status = $this->handleRouteRequirements($pathinfo, $name, $route);

            if (self::ROUTE_MATCH === $status[0]) {
                return $status[1];
            }

            if (self::REQUIREMENT_MISMATCH === $status[0]) {
                continue;
            }

            return $this->getAttributes($route, $name, array_replace($matches, $hostMatches));
        }
    }

if two routes with same path_info is defined and has different Controller end-points Your cache implementation will always call the first match of the cache entry against the path but overlooks the rest of route matching logic in symfony.

public function match($pathInfo)
    {
        $key = 'route_' . $pathInfo;
        if ($this->cache->contains($key)) {
            return $this->cache->fetch($key);
        }

        $match = parent::match($pathInfo);
        $this->cache->save($key, $match, 60 * 60 * 24 * 7);

        return $match;
    }

at least $key should include minimal request method to overcome issue, however if there are complex routes defines with extra requirements other than request method then the cache key generation should take into account of all requirements of a route.

Metadata and Memcached

It also appears that clearing the metadata cache doesn't work with memcached

To reproduce:

Create an entity and store cache in memcached
Edit / Add / Remove a column from the entity and attempt to perform a doctrine schema update

Persistant connexion never close

Experiencing a weird issue with cache-bundle.

Using cache-bundle with persistant:true on configuration, persistant connexion never close and memcached current_openned_connection number never stop increasing.

Routing Caching with FOS Rest Bundle

If you use fos/rest bundle and using routing caching from aequasi memcache bundle, the bundle does not stores the http verb to cache.

you have two routes:

  • GET /user/profile
  • PUT /user/profile

If you send a PUT without routing caching enabled, it jumps in the right method. If you send a PUT with routing caching enabled, it jumps in getUserProfile instead of putUserProfile.

It would be better, if you also cache the http verb: e.g.: get_user_profile, put_user_profile

symfoy3 support

Cant install this bundle on symfony3:

composer update
....
- aequasi/cache-bundle 3.0.2 requires symfony/symfony ~2.2 -> no matching package found.

Any plans to support symfony3 soon?
Or how can i make composor ignore the dependency?

unable to setup without session

If you do not setup the session storage (e.g. because you want to store the data in the database like we do) the bundle cannot be setup properly:

ContextErrorException: Notice: Undefined index: instance in /home/benjamin/www/web/vendor/aequasi/cache-bundle/src/Aequasi/Bundle/CacheBundle/DependencyInjection/Compiler/SessionSupportCompilerPass.php line 42

Use other type of cache

Hi !

I want to try file cache, but i get this error :
file is not a valid cache type. If you are using a custom type, make sure to add your service.

And i see in services.yml there are many caches services: array, xcache, ...
But the config only accept : 'redis', 'file', 'memcached', 'apc'.

Is it possible to use these other services ?

Thanks for your help

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.