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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:56:24+00:00 2026-05-15T13:56:24+00:00

I current utilize the APC apc_store function as a means to replace items in

  • 0

I current utilize the APC “apc_store” function as a means to replace items in the cache that already exists, but I’m not sure if the TTL gets reset or not. I’d like to have it so it does NOT reset the TTL values.

  • 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-15T13:56:25+00:00Added an answer on May 15, 2026 at 1:56 pm

    The TTL you provided in apc_store will definitely overwrite the TTL of existing item. If you don’t provide TTL, the item will never expire.

    TTL is relative, number of seconds from now. If you want a fixed value, just use the same value on every apc_store call.

    If you want the item expire at an absolute time, you need to store the time with your object and calculate TTL every time. For example,

    $obj = apc_fetch($key);
    
    if (!$obj) {
        $obj = new MyObject();
        $obj->expiry = time() + 24*60*60; // Expires 24 hours later
    }
    
    $ttl = $obj->expiry - time();
    
    if ($ttl <= 0) {
       // Item expired
    } else {
       apc_store($key, $obj, $ttl);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working under the assumption that -performSelector:withObject:afterDelay: does not utilize threading, but
current code (not working): /^script\s*type=\text\/javascript/i.test(tagName)
current code I've built function to do something over collection of jQuery elements: var
Wihtin my current project I have to add data items to a List<> object.
I'm trying to utilize ZeroClipboard (http://code.google.com/p/zeroclipboard/wiki/Instructions) to copy the current URL to the user's
Our current O/RM tool does not really allow for rich domain models, so we
I have a Tomcat application that requires multiple passwords on startup. My current configuration
I realize these questions have been asked before on Stackoverflow, but now that FBML
I fully realize that what I am proposing does not follow the .NET guidelines,
I am completely stumped on this one. I have to utilize the current 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.