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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:57:32+00:00 2026-05-15T05:57:32+00:00

I am using Symfony 1.3.2 and I have a page that uses a partial

  • 0

I am using Symfony 1.3.2 and I have a page that uses a partial from another module.

I have two modules: ‘foo’ and ‘foobar’. In module ‘foo’, I have an ‘index’ action, which uses a partial from the ‘foobar’ module.

so foo/indexSuccess.php looks something like this:

<?php
<div id = 'container'>
   <div id='part1'>Some data here</div>
   <div id='part2'><?php include_partial('foobar/foobar_partial', $partial_params); ?></div>
</div>
?>

I want to cache ‘part2’ of my foo/indexSuccess.php page, because it is very expensive (slow). I want the cache to have a lifetime of about 10 minutes.

In apps/frontend/modules/foo/config/cache.yml

I need to know how to cache ‘part2’ of the page (i.e. the [very expensive] partial part of the page. can anyone tell me what entries are required in the cache.yml file?

  • 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-05-15T05:57:32+00:00Added an answer on May 15, 2026 at 5:57 am

    If you want to cache the partial named ‘part2’ of the ‘foobar’ module, you need to add these lines to the file apps/frontend/modules/foobar/config/cache.yml

    _part2:
      enabled:  on
      lifetime: 600 # 10 minutes
    

    When you then call the partial from your index action in foo, a cached version (if available) will be shown:

    <?php include_partial('foobar/part2') ?>
    

    If you want to cache a different version of the partial for each template that calls it, you should edit the cache.yml file like this:

    _part2:
      enabled:    on
      lifetime:   600 # 10 minutes
      contextual: true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we using symfony 1.0. We have an module work with Propel objects. The sql-querys
I use symfony 1.4 In my index page, I have created some fields as
Using Symfony 1.3 I have a normal form-filter that is used to filter values
I'm using Symfony 1.4 and I have to create pdf file from Word/HTML with
I'm having trouble executing the lessc compiler from PHP. I'm using Symfony, and have
I'm using symfony 1.4 doctrine. I have a code that can validate phone numbers
I'm using symfony 1.4.8 and I have some code that basically looks like this
I'm using Symfony 2 with Doctrine. I have 4 classes: Country, District, County and
I'm building a site using symfony php framework. I have a link in my
I am new to symfony. I have created a registration form using the code:

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.