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
Share on other sites

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 ;).

Edited by BagoZonde
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.