Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Apache and Caching
PostPosted: Tue Jul 20, 2010 17:11 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69722
Location: Your Mum
Hi.
I've not done any research into this because I'm a lazy bastard busy, but imagine this scenario:

User uploads image.
Web service takes image, and gives user a url which will eventually hold his image.
In the meantime, web service puts a placeholder image in the location the url points to.
x amount of time goes by, and the image the user uploaded is messed about with with.
Finally, the placeholder image is overwritten by the uploaded and reprocessed image.


So, I want the server to tell any clients to cache the image (pretty much) forever, but only once it has been reprocessed, otherwise it shouldn't cache it at all. Anything before that and it'll just be caching the placeholder, which will have the same filename.

Going from what I remember from the top of my head this is possible if I put each image into its own folder and copied a .htaccess file in with them (saying "don't cache me"), and replaced said .htaccess file (with one that says "cache me hard, big boy") once the image was done.

Is it doable without putting everything into its own folder?

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Apache and Caching
PostPosted: Tue Jul 20, 2010 17:18 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
Serve the images from a PHP script and send an ETAG header. Although Apache might actually handle that anyway for JPGs on the disk.


Top
 Profile  
 
 Post subject: Re: Apache and Caching
PostPosted: Tue Jul 20, 2010 17:20 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69722
Location: Your Mum
Could do, but using PHP involves extra workload every time an image is called. Shit's going to be busy, yo.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Apache and Caching
PostPosted: Tue Jul 20, 2010 17:21 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69722
Location: Your Mum
Oh, and the other little issue was "images" was a substitute for "files".

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC. RIP, Dimmers.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.