Denees
Denees

Reputation: 9198

Caching web applications in Java

I'm new to this, so, sorry if I'm wrong.

Upvotes: 5

Views: 1719

Answers (4)

Umesh Awasthi
Umesh Awasthi

Reputation: 23587

Well there are ways to have some performance tips both at database levels and Application levels.

For database levels here are few inputs

  1. Query optimization
  2. Indexes creation on frequent asked data.

For some ORM layers like hibernate it also provides some sort of mechanism to cache the outputs in primary levels and secondary levels.

For application levels we have many options few of them are

1.EHCache 2. Memcached

JCS

here is a complete list of java based caching frameworks

java-caching-system

and some googling will help you to find many other options for UI layers there are lots of area of improvements like

  1. Proper use of HTTP headers
  2. Less number of server Hits.
  3. Way to load javascripts
  4. Way to load CSS files
  5. use of CDN severs

Yahoo has very good blog for this.YSLOW from YAHOO.If you are in the early stage of development i will suggest not to go for them as they lead to premature optimization and can lead to may problems.

Upvotes: 7

Ravi Vanapalli
Ravi Vanapalli

Reputation: 9942

Why don't you look at below links which could help you.

Article1

Article2

Upvotes: 4

Thomas Johan Eggum
Thomas Johan Eggum

Reputation: 915

Frameworks exist for this purpose and Ehcache is one of them. Here you can read up on how you can use it:ehcache

Upvotes: 3

alf
alf

Reputation: 8513

Unfortunately, the question is way too broad (there are books on the topic, so it literally falls in the FAQ definition of offtopic)—and thus is likely to be closed soon.

In brief, there are plenty of Java caching solutions, including for example Guava and ehcache.

The three best techniques would be:

  1. Profile
  2. Profile
  3. Profile

First, before changing anything, second, to make sure your changes have effect, third time in production, to make sure your changes do work in real life.

On the levels—both, the decision depends on the profiling data.

Upvotes: 2

Related Questions