Skip to content

kanniselvan/SpringCacheDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringCacheDemo

Overview

SpringCacheDemo is a sample application that demonstrates how to implement caching within a Spring Boot application. It aims to showcase the usage of Spring's caching abstraction to optimize performance and resource utilization.

Features

  • Easy integration with Spring Boot
  • Supports various caching providers (e.g., EhCache, Redis)
  • Simple examples to demonstrate caching strategies
  • RESTful API endpoints for resource access

Project Structure

SpringCacheDemo
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │       └── example
│   │   │           └── springcachedemo
│   │   └── resources
│   │       └── application.properties
├── README.md
└── pom.xml

Installation

  1. Clone the repository:

    git clone https://github.com/kanniselvan/SpringCacheDemo.git
    cd SpringCacheDemo
  2. Install the required dependencies using Maven:

    mvn install
  3. Run the application:

    mvn spring-boot:run

API Endpoints

Get Cached Resource

  • Endpoint: /api/resource/{id}
  • Method: GET
  • Description: Retrieves a resource by its ID. The result is cached.

Clear Cache

  • Endpoint: /api/cache/clear
  • Method: POST
  • Description: Clears the cache for all resources.

Usage Examples

Retrieving a Resource

curl -X GET http://localhost:8080/api/resource/1

Clearing the Cache

curl -X POST http://localhost:8080/api/cache/clear

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages