Ehcache integration possible?

Hello i’ve done a vaadin portlet but its giving constant answer to all users.
I want to cache Vaadin output , if someone requests portlet , it should give answer from answer whenever i want.

To do it ;

There is @Cacheable annotation on Ehcache but there is some problem.
@Cacheable seems like cache for parameter.

But vaadin’s

public final void init()

doesn’t have any parameter and no output seen on parameter to cache.

How can i implement cacheable or cacheing on vaadin ?

No one have idea???
We can’t get output stream with application and session keys to do cache?

I’ve seen this but i donno how to integrate this with vaadin.
It would be great to add ehcache support navitely on vaadin.

That speeds up vaadin applications much faster.

This can’t work easily. Read again the section on Vaadin architecture in the Book. Each user interface component you see on the browser produced a GWT class (javascript compiled from Java source) that is receiving UIDL instructions from a corresponding server-side Java class. The page is constructed in the browser, based on these instructions – Vaadin is not constructing HTML on the server that you could cache.

At least if vaadin team would make some patch integration for next versions of vaadin integrating with caching systems will be great much.

Caching is not a good idea when serving secured content.

Well its true its not secure if it will be available automatically but as i written on top ,
@Cacheable annotation

It should be allowed developer to use it manually , but vaadin doesn’t support caching at all.
I don’t think its good to generate same request for all users , wasting cpu time much.

For example with the help of developer ,
@Cacheable makes server side caching
also there is client side caching by using html5 storage api.

@CacheClient will make client side storage …
Just an idea…

For non secure contents , developer can use them on vaadin.
Even JSF has Caching mechanism but i donno why vaadin doesn’t have.

IT will be great if you add manually controlled caching support…

Unlike e.g. JSF, Vaadin is not a page based framework. Because of this, page caching just does not make sense. Please read the
architecture chapter

Note that the UI structure of the portlet is not in the (very short) page sent as HTML but in a separate UIDL message requested by the client side engine once it has initialized itself. If your application is interactive in any way, the server side structure of the UI must be initialized for every session and the client has to request data specific to that session anyway. This is inherent in how frameworks like Vaadin work.

Anyway, what would you want to achieve with caching here?
If you want to do caching because you have tested that your application is too slow or consumes too much server side resources, most likely the best option would be to profile the application and just cache some internal data from the back-end with whichever mechanism is appropriate - the bottleneck is unlikely to be on the UI side.
If you have completely or almost completely static content and want to avoid the clients loading anything “extra” such as the widgetset (most parts of which are cached on the client after an initial load), Vaadin is probably not the best tool for your task.

Yes you are right.
So that means , for every page calls its better to use JSF instead of Vaadin.

For Ajax & WebSocket widget solution , vaadin better…

I was using Vaadin widget as a navigation bar that has no ajax at all.
On every page call from Liferay , footer was showing vaadin portlet.

But i’ll switch to JSF .
Its better for non ajax systems…

What do you think about cacheable button clicks or cachable events?
For example , instead of asking server same question , once get result if method if cacheable , so it will give result without sending anything to server?

I mean , decreasing AJAX calls , it will be good for vaadin to do it ?

Vaadin is a server based framework and I don’t see how this could be done generically with Vaadin.

However, it is certainly possible to create a custom widget for Vaadin which does cache things on the client side. There is even an add-on (
, status beta) that lets you move certain simple actions to the client side without writing custom client side code.