473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

clear cache tag in PHP?

28
I'm frequently updating images on my site when the users clicks on the submit button, and some users have reported they are seeing old images where new ones should be...

The image that is getting uploaded is the png image.

But the new images gets uploaded and also the old images is getting deleted

I assume this is a caching issue.

does anyone know of some code I can put into my PHP to clear the cache from certain pages???

I have tried using this code, but it doenst work, still having the same issue.

header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
$ExpStr = "Expires: " . gmdate("D, d M Y H:i: s ", time() ) . " GMT";
Header($ExpStr);
header('Cache-Control: public, no-cache');

Any help will be greatly appreciable.
Sep 19 '06 #1
2 5317
ronverdonk
4,258 Expert 4TB
Are you sure your (GMT) date is set in the PAST??

Ronald :cool:
Sep 21 '06 #2
tbb9216
16
why dont you try making it expire a LONG time ago, perhaps at the unix epoch?

-tim
Sep 22 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sure | last post by:
Hello Group, I have a php file which will list the pending task for each developer. If the developer changes some thing it will update to database. Once the user clicks the update button it...
2
by: Romy Sreedharan | last post by:
Hello, I am wondering whether there is a mechanism to clear the Hard Disk Cache using C#? This is for O.S Windows XP regards romy
2
by: Les Caudle | last post by:
When displaying a database driven product page, I cache the page using: <%@ OutputCache Duration="86400" VaryByParam="ProductID" %> which works fine UNLESS I change the pricing or description...
3
by: DC Gringo | last post by:
I have an app that I can't seem to clear out server resources with a button onclick event: The session variables seem to be disappearing properly, but the aspnet_wp.exe process stays where it...
5
by: tshad | last post by:
When I log of I do: HttpContext.Current.Session.Clear() FormsAuthentication.SignOut() The problem is that it clears the variables that I set up in my Session_Start function in my...
3
by: Janning Vygen | last post by:
Hi, i am testing a few queries in my postgresql DB. The first query after reboot is always slower because of an empty OS page/file cache. I want to test my queries without any files in the...
1
by: Records For Living Support | last post by:
I've just upgraded from Visual Studio 2003 to 2005 and I've finally got my website working on my laptop. WHen I try to send it over to the real webserver - it fails miserably. I've had MULTIPLE...
2
by: ESmith | last post by:
How can I clear the current session cache of previously visited webpages? That is, say I start up my app (with browser component), point to www.cnn.com, click on several links, then I want to...
4
by: Adrian Parker | last post by:
We've suddenly started getting a problem with a call to clear the contents of a DataTable. This is on a live customer site that's been working fine until yesterday. As far as we know they've not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.