Nick Fisher's tech blog

Aspect Oriented Programming

How To Invalidate an Nginx Cache In a Reverse Proxy Setup With Spring MVC

You can see the sample code associated with this post on Github.

In two previous posts, we looked at how to provision a reverse proxy using nginx and then how to add caching to the nginx reverse proxy. The implementation we ended up with at the end of the last post was a “dumb” cache, meaning that it doesn’t know when or if any data gets updated–it just times out after 60 seconds and then asks for a new payload from the application it’s acting as proxy for.

How to Use Spring's Aspect Oriented Programming to log all Public Methods

The sample code for this post can be found on GitHub.

Aspect Oriented Programming In Spring is a clever way to reduce code duplication, by taking a different approach than traditional tools like dependency injection or inheritance. Cross cutting concerns like security and logging can permeate a code base and make maintainability a nightmare unless properly taken care of, and aspect oriented programming is one way to properly take care of that, when used appropriately. This post will illustrate how to get started with a transparent way to log without cluttering up business logic.