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

  • Home
  • SEARCH
  • 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 3424616
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:29:44+00:00 2026-05-18T06:29:44+00:00

our drupal site has some user specific content. When we enable page caching the

  • 0

our drupal site has some user specific content. When we enable page caching the whole page is being cached. Isn’t it possible to cache only fragments of the page. Or specify which fragments not to cache? Or even specify which pages not to cache. This way we can remove some stuff from the caches when logged in. Or don’t use the cached versions when logged in.

I found this website already but it doesn’t seem to work:
http://www.jpstacey.info/blog/2009/03/03/how-to-not-cache-a-particular-drupal-page

But this doesn’t seem to work.

kind regards,
Daan

  • 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-18T06:29:45+00:00Added an answer on May 18, 2026 at 6:29 am

    First, I second Ran Bar-Ziks suggestion of putting the ‘not to be cached’ data in a separate block and set that block to BLOCK_NO_CACHE, as it is the simplest solution.

    If that is not possible, you can disable caching of specific pages, but contrary to the suggestion from the link you posted, I’d do this by preventing the page from getting cached in the first place (rather than removing the cache entry afterwards).

    To do this, you can manipulate the global cache config setting temporarily on the page in question:

    // Disable caching for this request cycle
    $GLOBALS['conf']['cache'] = FALSE;
    

    Where you put this code depends on the pages you want to exclude from caching:

    • If it is a custom node type coming from your own module, you’d put it in hook_view.
    • If you want to do this for a node type coming from other modules, you can put it in ‘view’ operation part on a hook_nodeapi() implementation.
      ** This would also also work for individual nodes, if you add a check for the node id before disabling the cache.
    • If you need to do this based on paths, you could put it in a hook_init() implementation, checking for the path (or path alias) to decide whether to disable caching or not.

    It should be obvious that you need to clear caches first for any of these approaches to work, as they depend on preventing the page from being cached at all. They will not remove an already paged entry from the cache.

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

Sidebar

Related Questions

Our ASP.NET 3.5 website running on IIS 6 has two teams that are adding
Our Tfs server (Tfs2008) has smtp server installed. But we could not make Tfs
Our company is currently writing a GUI automation testing tool for compact framework applications.
Our team develops distributed winform apps. We use ClickOnce for deployment and are very
Our team is creating a new recruitment workflow system to replace an old one.
Our dev shop currently uses Visual SourceSafe. We all know how that could end
Our EPOS system copies data by compressing the database into a zip file, and
Our application is interfacing with a lot of web services these days. We have
Our security manager dynamically inserts a bit of javascript at the top of every
Our web services are distributed across different servers for various reasons (such as decreasing

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.