Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with cache output/file #165

Closed
brandonlamb opened this issue Nov 5, 2012 · 4 comments
Closed

Problem with cache output/file #165

brandonlamb opened this issue Nov 5, 2012 · 4 comments
Labels
bug A bug report status: medium Medium
Milestone

Comments

@brandonlamb
Copy link

Posting here (hopefully not double) as I didnt see my mail to the list show up anywhere...

In my applicatoin.php i have:

$di->set('viewCache', function() {
   $frontCache = new Phalcon\Cache\Frontend\Output(array('lifetime' => 300));
   return new Phalcon\Cache\Backend\File($frontCache, array('cacheDir' => \PATH . '/protected/cache/'));
});

and in my indexcontroller->indexaction():

    $this->view->cache(array('key' => 'index', 'lifetime' => 4800));

When i hit my index, i see a index file created in the cache dir and the output looks good. I refresh my browser, and the cache file is zeroed out.

Any ideas?

@niden
Copy link
Member

niden commented Nov 5, 2012

I am wondering if it times out (lifetime => 300 seconds)

Also

$this->view->cache(array('key' => 'index', 'lifetime' => 4800));

shouldn't that be

$this->cache(array('key' => 'index', 'lifetime' => 4800));

On Sun, Nov 4, 2012 at 7:15 PM, Brandon Lamb notifications@github.comwrote:

$this->view->cache(array('key' => 'index', 'lifetime' => 4800));

@brandonlamb
Copy link
Author

No, I had seen $this->view->cache(true); somewhere so used that.

I dont think its a timeout, because if i clean my cache directory, load my page, a file with proper html content is created in cachedir, then i refresh within a second or two, and my page is rendered again,but my cache file is zeroed out, if i refresh immediately a third time i get a blank page

@xboston
Copy link
Contributor

xboston commented Nov 5, 2012

+1
Confirmed problem.

@niden
Copy link
Member

niden commented Nov 5, 2012

Thanks for the report guys. We will work on this mid to end this week and
will be fixed in 0.6.1

@phalcon phalcon closed this as completed in b249d4e Nov 8, 2012
@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

3 participants