Caching issue with My Cats image update?

A historical forum for issues reported in the suggestions and bugs forum that have been subsequently fixed or resolved.
Post Reply
User avatar
MatsP
Posts: 21038
Joined: 06 Oct 2004, 13:58
My articles: 4
My images: 28
My cats species list: 117 (i:33, k:0)
My aquaria list: 10 (i:8)
My BLogs: 4 (i:0, p:164)
Spotted: 187
Location 1: North of Cambridge
Location 2: England.

Caching issue with My Cats image update?

Post by MatsP »

When I added an image for my second group of Mystus mysticetus, it showed the OLD image for that species for a few reloads of the page. Once it did update, it is with a different "random gobledegook" after the image name. I'm guessing this is to do with the "fast pages"...

--
Mats
User avatar
Jools
Expert
Posts: 16277
Joined: 30 Dec 2002, 15:25
My articles: 198
My images: 941
My catfish: 237
My cats species list: 87 (i:13, k:1)
My BLogs: 7 (i:10, p:167)
My Wishlist: 23
Spotted: 450
Location 1: Middle Earth,
Location 2: Scotland
Interests: All things aquatic, Sci-Fi, photography and travel. Oh, and beer.
Contact:

Re: Caching issue with My Cats image update?

Post by Jools »

Yes, it's the (server) layer image caching. It shouldn't be much longer than 30 seconds.

Jools
User avatar
MatsP
Posts: 21038
Joined: 06 Oct 2004, 13:58
My articles: 4
My images: 28
My cats species list: 117 (i:33, k:0)
My aquaria list: 10 (i:8)
My BLogs: 4 (i:0, p:164)
Spotted: 187
Location 1: North of Cambridge
Location 2: England.

Re: Caching issue with My Cats image update?

Post by MatsP »

Is there any way to "force" the cache update? Because the page is showing the "new" image, but it's actually showing the old one, since it's not been updated yet...

--
Mats
User avatar
Jools
Expert
Posts: 16277
Joined: 30 Dec 2002, 15:25
My articles: 198
My images: 941
My catfish: 237
My cats species list: 87 (i:13, k:1)
My BLogs: 7 (i:10, p:167)
My Wishlist: 23
Spotted: 450
Location 1: Middle Earth,
Location 2: Scotland
Interests: All things aquatic, Sci-Fi, photography and travel. Oh, and beer.
Contact:

Re: Caching issue with My Cats image update?

Post by Jools »

Sorry Mats, you've lost me. Meantime, I have deleted all cached "my cats" pics.

Jools
User avatar
MatsP
Posts: 21038
Joined: 06 Oct 2004, 13:58
My articles: 4
My images: 28
My cats species list: 117 (i:33, k:0)
My aquaria list: 10 (i:8)
My BLogs: 4 (i:0, p:164)
Spotted: 187
Location 1: North of Cambridge
Location 2: England.

Re: Caching issue with My Cats image update?

Post by MatsP »

Sorry, it was clear in my head when I wrote it ;)

Say I have Picter A as my picture for Species X. I then update to Picture B. I press submit. It shows Picture A. Then later on, when I view it agin, it shows Picture B, as I would have expected in the first place.

I've attached a screenshot:
screenshot2.jpg
Now, the "picture B" in this case is:
IMG_0082.JPG
So, I'm wondering if there is a way to "invalidate" or "clear" the cache when an update has been made, so that it shows Picture B instead of Picture A? Or in some other way tell the caching software that "Something has changed, please update now"?

Or at least, the page that turns up should say something like "We've updated your picture, but it will take a few minutes before the cache is updated", perhaps?

--
Mats
User avatar
Jools
Expert
Posts: 16277
Joined: 30 Dec 2002, 15:25
My articles: 198
My images: 941
My catfish: 237
My cats species list: 87 (i:13, k:1)
My BLogs: 7 (i:10, p:167)
My Wishlist: 23
Spotted: 450
Location 1: Middle Earth,
Location 2: Scotland
Interests: All things aquatic, Sci-Fi, photography and travel. Oh, and beer.
Contact:

Re: Caching issue with My Cats image update?

Post by Jools »

OK, yes, a timing issue, I understand now. So what you think I need to do is write a clear_cache($species) function to call after every upload (inc. admin). Right?

If so, I don't think this is the problem. I think it's at the higher cache level (apache). Will need to look more deeply.

Jools
User avatar
Jools
Expert
Posts: 16277
Joined: 30 Dec 2002, 15:25
My articles: 198
My images: 941
My catfish: 237
My cats species list: 87 (i:13, k:1)
My BLogs: 7 (i:10, p:167)
My Wishlist: 23
Spotted: 450
Location 1: Middle Earth,
Location 2: Scotland
Interests: All things aquatic, Sci-Fi, photography and travel. Oh, and beer.
Contact:

Re: Caching issue with My Cats image update?

Post by Jools »

http://code.google.com/speed/page-speed ... imize.html

It appears there is no way to selectively switch off image optimization. That's to say, most of the images on a page (for example, the little rounded corners on the menu options, the icons and many more) benefit from optimisation. However, when we upload a replacement image and try to display it, it suffers from the problem noted here that is it shows the old image for about 5-10 minutes before the cache catches up. I can't find a way to identify an image as "don't (or refresh) cache me" to the apache pagespeed mod.

There are two ways to fix this that I can see. 1) Switch off optimisation or 2) Ensure every uploaded image has a unique name.

The clever fix is 2) but that's a bit of work from where we are just now. So, I've gone for 1 (pagespeed caching switched off now), we will then look at 2) probably go for better image upload handling anyway.

Meantime, resolved, but would appreciate a test after about an hour to allow the server to settle itself.

Jools
User avatar
MatsP
Posts: 21038
Joined: 06 Oct 2004, 13:58
My articles: 4
My images: 28
My cats species list: 117 (i:33, k:0)
My aquaria list: 10 (i:8)
My BLogs: 4 (i:0, p:164)
Spotted: 187
Location 1: North of Cambridge
Location 2: England.

Re: Caching issue with My Cats image update?

Post by MatsP »

As I'm at work now, I'll test when I get home (where I have suitable pictures to play with).

Would 2 also, as a side-effect, allow picture per population? [I don't quite know how it works internally - I have a vague idea, but what confuses me is the fact that you can have a picture on population 1, and population 2. Then adding a picture for population 2 makes that picture appear for population 1 as well... I don't quite understand why that is...]

--
Mats
User avatar
Jools
Expert
Posts: 16277
Joined: 30 Dec 2002, 15:25
My articles: 198
My images: 941
My catfish: 237
My cats species list: 87 (i:13, k:1)
My BLogs: 7 (i:10, p:167)
My Wishlist: 23
Spotted: 450
Location 1: Middle Earth,
Location 2: Scotland
Interests: All things aquatic, Sci-Fi, photography and travel. Oh, and beer.
Contact:

Re: Caching issue with My Cats image update?

Post by Jools »

MatsP wrote:Would 2 also, as a side-effect, allow picture per population? [I don't quite know how it works internally - I have a vague idea, but what confuses me is the fact that you can have a picture on population 1, and population 2. Then adding a picture for population 2 makes that picture appear for population 1 as well... I don't quite understand why that is...]
Yes, it could.

The reason this works as it does is that the image uploaded for my cats is stored in the following format.

http://www.planetcatfish.com/images/[si ... ies]/1.jpg

Thus individual species population one,two or X for the same user will have the same filename. This has the very real advantage of an uploaded image file being readily identifiable. Adding the population ID would not be too hard however, I wish to consider the wider implication of species name reassignment. That's to say, if species X changes to species Y, how do we keep the images linked in (some admin renaming code).

Jools
User avatar
MatsP
Posts: 21038
Joined: 06 Oct 2004, 13:58
My articles: 4
My images: 28
My cats species list: 117 (i:33, k:0)
My aquaria list: 10 (i:8)
My BLogs: 4 (i:0, p:164)
Spotted: 187
Location 1: North of Cambridge
Location 2: England.

Re: Caching issue with My Cats image update?

Post by MatsP »

But couldn't that be done by having:
http://www.planetcatfish.com/images/[si ... nid]/1.jpg

Now, if we change family/genus/species name in the admin code, all you need to do is rename the appropriate (per user) directory. [it would be less work to if username was below the family/genus/species, but never mind that].

It gets more interesting if the user decides that what he/she thought was Panaque maccus is actually L167 (or whatever it is that looks similar but is a bit bigger), and "moves" one population of two into a new species.

But I can't say I have thought all the different scenarios through thoroughly here. Just blurting out what comes to mind, really.

--
Mats
Post Reply

Return to “All Resolved Issues”