Monday, September 10, 2007

Declarative caching in the UI layer

In my recent post about the architecture, I mentioned the fact that a fair amount of caching was taking place in the web UI layer. I'd like to expand on that.

The data consumed by web UI layer comes solely from the service layer. The services are injected into Tapestry components by Spring.

Let's take an example. If you look at the home page, you'll see that recently added crossword puzzles are displayed for different categories (e.g. American or British type puzzles). The Tapestry component responsible for outputting this bit of HTML uses the "constructor" (as in puzzle constructor) service, injected into the component at runtime. Since the component is located on a high traffic page, its performance needs to scale so hitting the service layer (and thus the database) on every requests is out of the question.

My first solution to this problem was to cache the service layer data in the component itself. It worked for a while but proved inflexible in the long run. For instance, depending on where a component was located (e.g. a high or low traffic page, etc), different caching strategies were needed.

My second solution (and the one I'm using now), was to configure caching proxies in Spring using Spring modules and Ehcache and inject those into the components instead of the real services. This way, I could decide to turn caching on or off depending on the specific needs of the component, without it being aware of anything.


Liza said...

Hi i am richa Rai working as goa escorts and for few time....
Goa Escort
Escorts in Goa
Goa Escort Services
Goa female Escorts

Nisha Kapoor said...

We provide Mumbai Escorts both incalls and outcalls throughout Mumbai so call me to party, to relax or just for a massage.

Escorts in Mumbai
Independent Mumbai Escorts
Mumbai Escorts Services

Rinky Arora said...

I am Sneha Kapoor From Mumbai Escorts. A total girlfriend experience, I will wow you from the moment you open the door. I am a 25 year old top-class Independent Mumbai Escort gorgeous companion and a busty blonde glamour girl. You will find me intelligent, classy, well mannered and educated, yet down to earth with a great sense of humor. I have a bubbly personality and can talk to anyone any where,

Booking Website:

mumbai escorts
independent mumbai escorts
mumbai escorts services
escorts in mumbai

Top Escorts Dubai Agency said...

Thanks for one’s posting! I quite enjoyed reading Your Post; you could be a Very great author. I will make sure to bookmark your blog now and will eventually come back in the foreseeable future always. I want to encourage you continue your great writing Skills, have a nice evening!
Indian Escorts In Dubai

Simran Kour said...

Lifestyle is too short to keep on remorse and unhappiness, so for those who are struggling from any kind of depressive disorders to have, obtaining the most appealing Ahmedabad Escorts Agency solutions perhaps.
Ahmedabad Escorts
Escorts in Ahmedabad
Ahmedabad Escorts Agency

Kavya Rai said...

This is actually essential because as long as the Ahmedabad Independent Escorts shall keep pleased and pleased this business shall keep on growing and achieve new levels every single day.
Ahmedabad Escorts
Kavya Escorts in Ahmedabad
Ahmedabad Independent Escorts

Ahmedabad Model said...

Ahmedabad Escorts genuine and passionate services help various clients to overcome grieves and depression. Visit:
Ahmedabad Escorts
Escorts in Ahmedabad
Ahmedabad Escorts Agency

Maya Pathak said...

One can go for a live chat period if the person wishes to do so before looking for a particular plan be offered by the Independent Call Girls in Ahmedabad.
Maya Pathak Ahmedabad Escorts
Ahmedabad Escorts Maya Pathak
Independent Call Girls in Ahmedabad

Tanishka Oberoi said...

The Independent Escorts in Ahmedabad are also available for serving their clients with some of the classiest and most exotic in call and out call services. Visit
Ahmedabad Escorts
Ahmedabad Escorts Tanishka
Ahmedabad Escorts Agency

Joya Khan said...

Escorts in Ahmedabad definitely take money to provide the services but they know that their services are premium and for that anyone is willing to pay. Visit: Visit:
Joya Ahmedabad Escorts
Joya Escorts in Ahmedabad
Ahmedabad Escorts Services

Neha Nand said...

Mumbai Independent Escorts are really devoted and know how to carry out their day to day projects in an pleased manner so that they can always keep the customers can use pleased and enthusiastic about their solutions every single time.
Hire Escorts in Mumbai
Mumbai Escorts Services
Mumbai Dating Escorts

Indian Beauty Queen said...

The rates and expenses associated with each of the help is based upon on the type of Ahmedabad Escorts assistance that has been selected by an personal.
Ahmedabad Escorts
Independent Escorts Ahmedabad
Hire Escorts Services in Ahmedabad

Nandita Sigh said...

We open up more and more, and at the end we started getting closer to Jaipur Escorts Girl.
Jaipur Escorts Girl
Female Escorts in Jaipur
Independent Escorts Services in Jaipur

maya pathak said...

Sometimes Surat Escorts stay for over a year, and they don’t want to leave our country but without money it will be hard for them to stay so long. Visit:
Surat Escorts
Surat Escorts Agency
Escorts in Surat

Maya Pathak said...

Escorts Services in Ahmedabad, Must be hot in order to lure the clients – one of the basic necessity of this job is to look hot.
Ahmedabad Female Escorts
Escorts Services in Ahmedabad
Independent Ahmedabad Escorts

ishika jain said...

Call +91-9911549535 for Independent Escort service in Delhi. DelhiHot offer sexy hot elite escorts in Delhi for your singularity entertainment.Delhi Escortsescorts in delhi
escorts service in delhi
call girl in delhi
call girl service in delhi

sonamsharma said...

Sonam Sharma provides one of the Rocking and Amazing Escort Service in Jaipur. Our aim is to provide you with a selection of stunning Jaipur escorts. These are well disposed in nature which can be effectively balanced by the state of mind of the clients. Their looks are enjoyed by the customers. They keep up great connection with the client's, so they can visit their organization over and over and bring down their services.

Bhuvi Rawat said...

Hello Bhuvi Rawat I am like all sex addicted girl escort in Goa. I am a young girl who has a lot of energy. It would be a surprising for me, if you are asking me what I did. I love going through the roof, and enjoy the most when I'm with a man. call girls in Goa, In call & Out call facility service available at an affordable cost of Rs 15000 per hour or 35000 for full night.

For more details
indepenedent Goa escorts
escorts in Goa
Goa escorts
Goa call girls
Call girls in Goa