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 7747251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:28:59+00:00 2026-06-01T10:28:59+00:00

I am using CakePHP 1.3 and Caching most of my elements. From what I

  • 0

I am using CakePHP 1.3 and Caching most of my elements. From what I read, Cake is supposed to clear the cache when a new post is created. However, it is not working for me automatically?

I typically use a plugin to clear the cache or I do this manually thru FTP.

Anyone has a suggestion for me that would make my life easier by having cake perform this for me AUTOMAGICALLY?

thanks,

  • 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-01T10:29:01+00:00Added an answer on June 1, 2026 at 10:29 am

    I believe CakePHP clears cache in the following manner:

    1. If there is an element ie. articles_most_viewed.ctp and it is called from within articles index.ctp file, then Cake will clear that respective element during an add, edit, delete action.
    2. However, if there is an element ie. frontpage_lastest_articles.ctp and it is only called in pages/display.ctp file (frontpage), then CakePHP will not clear that element since it is not being called from within the affected/changed model/view, in this case articles model/controller/view.

    I havent figure out how to better approach this issue, if there is a better way. However, my quick fix is to call clearCache() in my admin_add.ctp, admin_edit.ctp and admin_delete.ctp files as such:

    ...
    function admin_add(){
        ...
        if (!empty($this->data)) {
            if ($this->Article->save($this->data)) {
                // I call the following function to clear my entire Cache directory
                // after this action is successfully processed
                // ===========================================
                clearCache();
                // ===========================================
                $this->Session->setFlash('Your post has been saved.');
                $this->redirect(array('action' => 'index'));
            }
        }
    }
    

    There might be a better way to handle this, but this is my solution for now. I would be glad to know if there is a better/automagic solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After I uploaded my application created using cakephp, I found out that I had
I'm trying to create an XML sitemap using CakePHP, from a table which has
Using CakePHP 1.3, I have the following layout: /srv/www/_cakephp13/ /app/ /cake/ /plugins/ /vendors/ etc...
Using CakePHP, I created select-option form element with: echo $form->select('items', $numeration , array('selected' =>
We are using Cakephp framework version 2.0.6 The site is supposed to allow an
I am doing some sql caching of certain queries. I'm using CakePHP so the
I am using CakePHP with Apache2. Analyzing my pages with the tool PageSpeed from
I'm using Memcached in a CakePHP application to cache MySQL result sets. One result
I am using CakePHP and getting the following error Warning: Cache not configured properly.
Iam using cakephp ajax link for calling a page <div id=post> </div> <?php echo

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.