Jump to content

PHP Cache Issue


lewisstevens1

Recommended Posts

Hello guys, hope you can help.

 

I have a PHP script where users can upload and crop their profile photo, there's one problem though..

 

Sometimes after their account profile photo has been uploaded, it displays in the crop box, although when users actually go to crop sometimes they don't see an update and sometimes they do.

 

I tried adding a refresh button but that doesn't seem to do it.

 

The only way they can view the update is by pressing F5.

 

Ive tried adding:

 <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
	<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

 

in the html.

 

I even added:

		header("Cache-Control: no-cache, must-revalidate");
	header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

 

in the PHP.

 

What can i do?

 

Many thanks

Lewis Stevens

 

post-62498-0-22795800-1358773334_thumb.jpg

Link to comment
https://forums.phpfreaks.com/topic/273422-php-cache-issue/
Share on other sites

  On 1/21/2013 at 2:51 PM, Jessica said:

You need the timestamp, not just the ?.

 

That's right. lewisstevens1, you need to change filename every time so it's cool to change part after query sign.

 

BTW. I'm using date('YmdHis') instead of timestamp() as I'm thinking in blind-assembler-way ;) for 1MHz machines: OPTIMIZE ;). But sincerely this difference wasn't tested yet, haha ;).

Link to comment
https://forums.phpfreaks.com/topic/273422-php-cache-issue/#findComment-1407268
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.