Page Refresh Problem after uploding image

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
viplave
Forum Newbie
Posts: 3
Joined: Tue Feb 05, 2008 7:15 am

Page Refresh Problem after uploding image

Post by viplave »

I am working on a site where member can edit their profile. When a member want to change his image and upload a newer one he can't see the immediate effect of changing the image in his profile as the page holds the old one. Please help to solve this problem.

Viplave
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Page Refresh Problem after uploding image

Post by Christopher »

Set headers to tell the browser not to cache the page.
(#10850)
User avatar
dbevfat
Forum Contributor
Posts: 126
Joined: Tue Jun 28, 2005 2:47 pm
Location: Ljubljana, Slovenia

Re: Page Refresh Problem after uploding image

Post by dbevfat »

A better approach (internet- and user-friendly) is to cache the image indefinitely and change the URL for a member's pic when the user changes it. This way you make sure visitors will get the fresh picture while you'll use the most of caching mechanisms at the same time.

Here's an interesting article on the subject: http://www.mnot.net/cache_docs/.
Post Reply