Erlang/OTP Forums

Author Message

<  Advanced Erlang/OTP  ~  Yaws -- help with appmod controller and caching etc

seancharles
Posted: Thu Apr 09, 2009 12:24 pm Reply with quote
User Joined: 18 Jul 2007 Posts: 57
This is driving me nuts!

If I have a single index.yaws page that does this:
Code:

<erl>
out(A)->ctrl:out(A).
</erl>

Then when I generate an IMG tag it just works, as does pulling in the jQuery and PURE js files.

If I then install a single controlling appmod as:
Code:
appmode = </,ctrl>
then the images and Javascript all stop working.

I know *why* this happens but I really don't know what is the best way to deal with it. It means that my controller module would have to check for url requests starting with "images", "css", "js" etc etc and set the return type and send back the data.

Yaws already does that very well AND it caches stuff to and I really want to be able to use all that lovely behavior and still have a single controller module.

I have tried to read the Yaws code but I haven't yet found what I am looking for... I've studied the yaws_api return values and maybe what is needed is something like:
Code:
{passthru}
which would instruct Yaws to handle the request as per normal, although ideally it would never trouble me in the first place

leading to...

Perhaps an extra configuration key in the .conf file might do the trick, sort of the inverse of appmod, which tells yaws to always handle any url that begins with the strings supplied:
Code:
yawsdoes = [ "images", "css", "js" ]


This would have priority over appmod entries so that all your appmods need to do is what they do without having to worry about anything else.

I am going to see what I can do to achieve either of the above or find another way but any light or pointers(!) or guidance would be appreciated.

Many thanks,
Sean Charles.
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