Etags / Cache headers / No cache / Cache busting

2016-07-30 9:00 PM (8 years ago)

You can guess it from the title : this new release is all about HTTP Caching! HTTP Caching is a fundamental part of any web framework and was obviously a required step before Spincast 1.0.0.

Many frameworks only manage a very little part of the HTTP specification regarding caching. In general, they limit their support to GET requests by returning a 304 - Not Modified response instead of the requested resource if this resource hasn't changed, and they validate this by hashing the generated resource and setting the result as an ETag header. This is useful in some cases, but is in fact very limited... HTTP caching is way more sophisticated than this!

At the core of HTTP Caching management using Spincast, there is a new request context add-on : "httpHeaders()". This add-on helps to create very compliant REST endpoints. Most of the "freshness" headers are managed : If-Match, If-None-Match, If-Modified-Since and If-Unmodified-Since. In the other direction, the add-on helps to send Cache-Control, ETag and Last-Modified headers. It is also possible to send "no cache" headers to tell a client that it should never cache the resource, at all. Some of those cache headers can also be specified on the routes, directly.

Finally, a Cache Busting mechanism has been added. By adding a special code to the URL of a resource, you can easily invalidate the cached versions clients may have of it. Read more about it here.

Spincast presentation + redirection rules

2016-07-10 7:00 PM (8 years ago)

We gave the website a small makeover! A cool presentation of Spincast and its features has been added to the home page. We also added a new section: Demos / Tutorials.

Finally, we implemented redirection rules. You can now easily specify that a route must be redirected to another one. This is useful, for example, when you change the URL of a resource but don't want the existing links to break.

Spincast testing utilities

2016-07-02 10:00 PM (8 years ago)

There is a new section in the documentation about testing your application using Spincast.

Spincast testing is first and foremost about using a Guice context to run the tests. We developed a custom JUnit runner to make this process very easy. This allows any dependency you need to be injected into your test classes.

Even cooler (in our opinion!), have a look the Integration test example to see how Spincast testing utilities can help you run tests on your actual application. No mocks, no simulation. This approach leads to very trustworthy tests since they are run on your real application, and not on a version where many components have been mocked.

WebSockets!

2016-06-18 12:00 AM (9 years ago)

We are very happy to announce that WebSockets support has been added to Spincast. It took a lot of work but the result is rewarding! This is a huge step toward Spincast 1.0.0.

Not only does Spincast now supports WebSockets server-side, but we also developed a new version of our HTTP Client, also with WebSockets support. If you need a very easy to use HTTP and WebSocket Java client, look no further! The popular Apache HttpClient doesn't support WebSockets yet.

Finally, we cannot release this version without a big "thank you!" to the folks at Undertow: our WebSockets implementation is based on a lot of code from them!

Easy HTTP authentication

2016-05-21 1:00 PM (9 years ago)

We added a way to easily protect some parts of your application with HTTP Authentication. A section about this topic has been added to the documentation.

The HTTP Client plugin has also been updated so you can specify a username/password when using the HTTP client to make a request to a resource protected by HTTP Authentication.

Finally, we also updated the Pebble plugin so you can add an extension. This allows you to add custom filters, functions, and more to the default templating engine. More information about extensions on Pebble website.