RejectedSoftware Forums

Sign up

Caching

Hi

I'm building a simple Rest API on vibe.d library. Mainly for learning purpose (but also practical :)). I need a simple caching implemented (for storing session. I want token authentication implemented). I couldn't find any hint on the web. Thanks :)

Re: Caching

On Sun, 26 Apr 2015 17:58:55 GMT, Dato wrote:

Hi

I'm building a simple Rest API on vibe.d library. Mainly for learning purpose (but also practical :)). I need a simple caching implemented (for storing session. I want token authentication implemented). I couldn't find any hint on the web. Thanks :)

Caching is a bit different from session management ;)
For "true" caching (not re-processing request that have already been processed), I suggest you use a front-end such as varnish (@s-ludwig probably has better suggestions on that topic).

To implement sessions in the REST interface, for the moment, there isn't something in place. It is possible to do, and surely a good exercise to learn about REST authentication.

At some point I plan to add something, but it takes time to get something good enough for a library.

I suggest you look at how to do basic/digest authentication and/or HMAC, depending on the level of security you want in your API.

Re: Caching

Hi. Thanks for your help. Actually, I'm just looking for a class similar to System.Web.Caching.Cache in .NET https://msdn.microsoft.com/en-us/library/system.web.caching.cache%28v=vs.110%29.aspx. I just want to persist objects in memory across several http calls.

Thanks :)

On Mon, 27 Apr 2015 04:03:44 GMT, Mathias LANG wrote:

On Sun, 26 Apr 2015 17:58:55 GMT, Dato wrote:

Hi

I'm building a simple Rest API on vibe.d library. Mainly for learning purpose (but also practical :)). I need a simple caching implemented (for storing session. I want token authentication implemented). I couldn't find any hint on the web. Thanks :)

Caching is a bit different from session management ;)
For "true" caching (not re-processing request that have already been processed), I suggest you use a front-end such as varnish (@s-ludwig probably has better suggestions on that topic).

To implement sessions in the REST interface, for the moment, there isn't something in place. It is possible to do, and surely a good exercise to learn about REST authentication.

At some point I plan to add something, but it takes time to get something good enough for a library.

I suggest you look at how to do basic/digest authentication and/or HMAC, depending on the level of security you want in your API.

Re: Caching

On Tue, 28 Apr 2015 17:11:13 GMT, Dato wrote:

Hi. Thanks for your help. Actually, I'm just looking for a class similar to System.Web.Caching.Cache in .NET https://msdn.microsoft.com/en-us/library/system.web.caching.cache%28v=vs.110%29.aspx. I just want to persist objects in memory across several http calls.

Thanks :)

Well, in this case, you either have the Web interface, or you have to implement it yourself.
Bear in mind that the server is shared between all requests, so you could use this, of some global state.
You might be interested in discussions here: https://github.com/rejectedsoftware/vibe.d/issues/425