phalcon cache long long time

191 views
Skip to first unread message

netstu

unread,
Jan 22, 2013, 12:43:41 AM1/22/13
to pha...@googlegroups.com
i use cache,but i want to part of caches persient util update the data. part of caches use the lifetime.

what params can do.

    $this->cache->save($key, $data,$lifetime);

$lifetime parame write what?

Nikolaos Dimopoulos

unread,
Jan 22, 2013, 9:24:51 AM1/22/13
to pha...@googlegroups.com
$lifetime is the time to live for your cached item. The value you put there is in seconds.

So if you want something to be cached for a long period of time (something that doesn't change that often) you put a high value.

Have a look at this example:


The contents of this message may contain confidential or privileged information and is intended solely for the recipient(s). Use or distribution to and by any other party is not authorized. If you are not the intended recipient, copying, distribution or use of the contents of this information is prohibited.



--
You received this message because you are subscribed to the Google Groups "Phalcon PHP Framework" group.
To post to this group, send email to pha...@googlegroups.com.
To unsubscribe from this group, send email to phalcon+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/phalcon/-/MJKEGZ7Ga8wJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

netstu

unread,
Jan 22, 2013, 8:20:24 PM1/22/13
to pha...@googlegroups.com
i understand how to use cache, i wish part of caches in project Never expires.

so, if param $lifetime setting a value done will well.

now, i only set a long time for $lifetime :)

my Spoken english  language is very poor, Exchange real trouble :))

在 2013年1月22日星期二UTC+8下午10时24分51秒,Nikolaos Dimopoulos写道:

Nikolaos Dimopoulos

unread,
Jan 22, 2013, 8:34:26 PM1/22/13
to pha...@googlegroups.com

Don't worry about your English. It is really good :)

You are correct, there is no way to set the cache never to expire.

Yes, setting it to a very long time (30 days) is the way to go. The performance impact of refreshing that cache is very small :)

To view this discussion on the web visit https://groups.google.com/d/msg/phalcon/-/jFuXixn5K6UJ.
Reply all
Reply to author
Forward
0 new messages