Erlang/OTP Forums

Author Message

<  Advanced Erlang/OTP  ~  Yaws cahcing -- exclusions.

seancharles
Posted: Mon Dec 03, 2007 8:23 pm Reply with quote
User Joined: 18 Jul 2007 Posts: 57
Does anybody know if there is a way to configure yaws to *not* cache an image file. I am thinking about a situation where an image is dynamically generated eg a stock chart for example, that you want to generate every time ?

Cheers
->Sean
View user's profile Send private message
Mazen
Posted: Wed Dec 05, 2007 10:52 am Reply with quote
User Joined: 20 Jul 2006 Posts: 164 Location: London
Have you tried:

cache_refresh_secs = 0

in your yaws.conf? Dunno if it helps for images but it does the trick for the pages anyway.

/Mazen
View user's profile Send private message
seancharles
Posted: Wed Dec 05, 2007 12:23 pm Reply with quote
User Joined: 18 Jul 2007 Posts: 57
Mazen,

My cache time is already at zero for development.

What I was trying to say is that, under normal circumstamces when yaws caches images etc etc I would like a way to be able to specifically tell it not to cache something because I want fresh meat every time the page is served up.

There may be something in the yaws docs I missed but I don't have the time to look right now.

I am sure it would be easy enough to make a modification to do this. I'll have a look myself sometime.

Cheers
->Sean
View user's profile Send private message
Mazen
Posted: Wed Dec 05, 2007 2:08 pm Reply with quote
User Joined: 20 Jul 2006 Posts: 164 Location: London
I see what you mean...

Although it wouldn't be as easy; my approach would be to have the path to the image as an appmod... this appmod would generate the picture and return the binary image (or similar). This would guarantee that the picture is always new. I have never done this in Erlang though.

Eg:
<img src="/images/randomimage" />

and add the appmod <randomimage, img_gen> where img_gen is the erlang module.

As I said... It should work in theory... but I've never tried it Smile

/Mazen
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

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 vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum