Cache::write() ) and I can see it appear in my filesystem.
The way I write the cache is as follows :
$post = null;
if( ($post = Cache::read('post_'.$id)) === false ){
$post = $this->Post->find('first',
array( 'conditions'=>array('Post.id'=>$id, 'Post.published'=>true),
'contain'=>array(
'ChildPost' => array(
'conditions' => array('published'=>true),
'Author','Attachment'
),'Category','Attachment') ) );
Cache::write('post_'.$id, $post);
}
$this->set('post',$post);
On Dec 5, 8:35 pm, "Ma'moon" <phpir...@gmail.com> wrote:
> Are you sure that you are calling Cache::write() ?
>
> On Sun, Dec 5, 2010 at 2:28 PM, Bart <bart.gloudem...@gmail.com> wrote:
> > Hi,
>
> > I'm using CakePHP 1.3.6.
> > I'm caching queries that retrieve single Posts in my controller. The
> > cache files are created nicely and I use the default Cache::config().
> > Now I expect my cache component to delete the cache file as soon as I
> > edit and save the post. But that doesn't happen.
>
> > I have tried all debug modes (0,1,2)
> > I also tried to use the syntax where the id of the Post is included in
> > the data-array or when it is delivered by saying:
> > $this->Post->id = $id;
> > prior to the save action.
> > The cache files that are created have permission code 666. (might that
> > be the problem?)
>
> > Does anyone have an idea what's going wrong?
> > Thanks a lot!
> > Bart
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment