part 1 of the post, we looked at how data can be cached through simple configuration. In this part, we are going to explore the cache keys.
In Codelooru is a technology blog that covers a variety of topics ranging from languages like Java, Spring, Groovy, databases like Cassandra, Postgresql, cloud services like AWS, Azure, etc.
Spring Cache - Part 1 - Introduction

Caching is an extremely important aspect of applications that care about lower latencies. There are a multitude of rules one has to adhere to while setting up a cache, in order to optimize the performance; but not overdo it. We will not get into those details in this post. Our focus would be on what Spring provides to enable caching in your applications.
JSON Property Name Customization in Jackson using PropertyNamingStrategy

How to Timeout JDBC Queries

Tarlog - Eclipse Plugin for Windows

Overriding Spring Beans with Aliases

I dislike this approach for two reasons.
ETags and Browser Cache

Caching resources on the browser is crucial to minimize unnecessary trips to the server and reduce the load on it. This works well for data that is static. But, there are cases where the data changes every once in a while (although less frequently), and you would want the browser to get the latest data without waiting for the cached data to expire. e.g., consider a scenario where a new version of the application is deployed with changes to CSS and javascript, and you want the user to experience these changes without forcing them to refresh their cache manually. One option you might consider is to make these resources non-cacheable and compromise the page performance a bit. Entity tags( or ETags for short) help you cache such resources, without the performance compromise.
Labels:
ETag,
HTTP,
If-Modified-Since,
If-Not-Match,
Last-Modified,
MVC,
Spring,
Spring-MVC
How does @ModelAttribute Work?

@ModelAttribute is a Spring-MVC annotation that is used for preparing the model data. It is also used to define the command object for binding the HTTP request data. The annotation works only if the class is a Controller class (i.e. annotated with @Controller).
ModelAttribute can be applied to both methods as well as method-parameters. It accepts an optional "value", which indicates the name of the attribute. If no value is supplied to the annotation, then the value would default to the return type name in case of methods and parameter type name in case of method-parameters.
The way Spring processes this annotation is,
ModelAttribute can be applied to both methods as well as method-parameters. It accepts an optional "value", which indicates the name of the attribute. If no value is supplied to the annotation, then the value would default to the return type name in case of methods and parameter type name in case of method-parameters.
The way Spring processes this annotation is,
Subscribe to:
Posts (Atom)