[erlang-questions] Cowboy static file cahce

J K jmakarlsson@REDACTED
Fri Jul 5 16:36:31 CEST 2013


Ok, I've already written a very simple cache function  (based on ets) for other usage, it just happens that you could probably use that to cache anything.

We might want to use SSL in our solution.

I guess I should do some measurements then.

NOTE: this is just html and js files so it might be that the OS caching function is sufficient.

Thanks,
Johan



>________________________________
> From: Loïc Hoguin <essen@REDACTED>
>To: J K <jmakarlsson@REDACTED> 
>Cc: Erlang Questions <erlang-questions@REDACTED> 
>Sent: Friday, July 5, 2013 4:08 PM
>Subject: Re: [erlang-questions] Cowboy static file cahce
> 
>
>On 07/05/2013 03:52 PM, J K wrote:
>> Hi,
>> does anyone know if Cowboy can do static file caching?
>
>It doesn't, you could do it, but you probably shouldn't do it.
>
>When using TCP the static handler will use sendfile to send the files. 
>Sendfile does the write directly from the kernel, and if the file was in 
>the kernel file cache (if it was requested before/enough) it'll be very 
>fast.
>
>When using SSL you can't just write the file to the socket. So you might 
>want something else.
>
>Generally the best solution is to use a CDN for files (on a cookie-less 
>domain) and this is the only recommendation we make. The static handler 
>is only there to help during development.
>
>-- 
>Loïc Hoguin
>Erlang Cowboy
>Nine Nines
>http://ninenines.eu
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130705/dc3ed509/attachment.htm>


More information about the erlang-questions mailing list