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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
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,