473,809 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

clear cache tag in PHP?

28 New Member
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 5334
ronverdonk
4,258 Recognized Expert Specialist
Are you sure your (GMT) date is set in the PAST??

Ronald :cool:
Sep 21 '06 #2
tbb9216
16 New Member
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
38172
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 shows the another page and there will be button back to list of pending task. It will again fetch from database. At the second time if user update some other data. It giving
2
8234
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
2942
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 for that page in the database. Then, I need to clear the cache (either for that specific productID- or for the aspx page and all the ProductID's it displays).
3
3175
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 had been upon running a heavy data query. At a normal standstill it's at about 30-40MB and even after the code below runs, it's up at 110MB. What am I doing wrong?
5
22157
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 Global.asax file. One of the variables I set up is:
3
12749
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 linux kernel cache, just to know what would be the worst execution time. At the moment i stop postgresql and do something like find / -name foo
1
1257
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 problems - but right now - the proble appears to be that teh 2.0 assembly cache contains an invalid copy of my web assembly - and I want to force it to clear the cache - and use the one I'm uploading to my website. THe MANAGE program seems to...
2
7621
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 programmatically clear the current session cache so if the user hits the back button, their current page is now, in reality, the start node and there is nothing to traverse to.
4
2962
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 changed or updated the server in any way. "There is no row at position 42" at System.Data.RBTree`1.GetNodeByIndex(int32 userIndex) at System.Data.DataTable.Clear(Boolean clearAll) at system.Data.DataTable.Clear()
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10635
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10378
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.