Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8214491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:28:54+00:00 2026-06-07T11:28:54+00:00

Regarding to cookbook we can cache elements like this: echo $this->element(‘helpbox’, array(), array(‘cache’ =>

  • 0

Regarding to cookbook we can cache elements like this:

echo $this->element('helpbox', array(), array('cache' => true));

Caching with configuration is like this:

echo $this->element('helpbox', array(),
    array('cache' => array('config' => 'view_long') );

How can I cache elements without predefined configuration ? How can I cache duration to elements? I tried this, but didn’t work:

echo $this->element('helpbox',  array(),
     array('cache' => array('time' => '+30 minutes')));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:28:56+00:00Added an answer on June 7, 2026 at 11:28 am

    You need to configure cache in app/Config/bootstrap.php:

    Cache::config('hour', array(
        'engine' => 'File',
        'duration' => '+1 hours',
        'path' => CACHE,
        'prefix' => 'cake_short_'
    ));
    
    Cache::config('week', array(
        'engine' => 'File',
        'duration' => '+1 week',
        'probability' => 100,
        'path' => CACHE . 'long' . DS,
    ));
    

    after this you can cache your element using defined configuration:

    echo $this->element('helpbox', array(), array('cache' => array('config' => 'week')));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Regarding to my other question: XML deserialize null elements? I've got elements like these
Regarding PHP security with cookies and sessions, this is what i have done so
Regarding this post and this other one . Suppose I have the following: public
Reading PHP & jQuery Cookbook right now and it gives this example for using
Regarding this SO article and this SO article. I looked at these after noticing
Regarding the backwards-incompatible change of Watir 0.5.x Finding elements by :class now matches partial
Regarding a line of this script: function Vehicle(hasEngine, hasWheels) { this.hasEngine = hasEngine ||
Some time ago, reading the App Engine Cookbook, I found this recipe based on
Regarding this question I had research lot and got the different suggestion, but non
Regarding this information: http://developers.facebook.com/docs/reference/rest/stream.publish Parameters: target_id and uid description says: If I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.