cache breaking pattern?

I want to keep the data cached on the client, but seems there’s a pattern that keeps breaking the cache, not that i know much about it, i just espect it to work. It’s certain that once something gets out of view on the client, it loads it again from the server when coming back in view, although nothing changed on the server side object. This is exceptionally bad. How to set stuff to remain cached on the client?

I have another topic like this, although that’s a bit particular
HERE

This tine it’s setContent, that’s a general found method in Vaadin.
The pattern remained the same, i keep the object in the server side, but the client side loads it from the server time each time it comes again into view.

private class CriteriaListener implements ClickListener {
		
		

		@Override
		public void buttonClick(ClickEvent event) {
			Button button = event.getButton();
			if (button.equals(frequency))
				loadContent();
			else if (button.equals(succession))
				loadContent();
			else if (button.equals(consecutives))
				loadContent();
		}
		
		private void loadContent(){
			if(activeSubFilter.equals(hiLo)) {
				if (hiLoFrequency == null)
					hiLoFrequency = new HiLoFrequency();
				sumsAnalysisContent.setContent(hiLoFrequency);
			} else if (activeSubFilter.equals(uhlh)) {
				sumsAnalysisContent.setContent(null);
			} else if (activeSubFilter.equals(entropy)) {
				sumsAnalysisContent.setContent(null);
			}
		}
	}

Does it matter that’s inside a listener class? This listener class is an inner class for another, that extends SplitPanel
, which also holds the references to the VerticalLayouts that get set to the panel i mentioned, which is another class. hiLoFrequency is yet another class, who’s reference is held within the one that extends SplitPanel.


Am i breaking any pattern that i am supposed to follow while programming with Vaadin?

BTW, setContent to null, doesn’t do what it sais in the doc:

I followed the code, and it’s suppose to, but it doesn’t.