<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mehdi Mediani</title>
    <description>The latest articles on DEV Community by Mehdi Mediani (@mediani-mehdi).</description>
    <link>https://dev.to/mediani-mehdi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F592575%2F63254289-7791-41aa-b254-15a46182c0a7.jpg</url>
      <title>DEV Community: Mehdi Mediani</title>
      <link>https://dev.to/mediani-mehdi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mediani-mehdi"/>
    <language>en</language>
    <item>
      <title>Boost Your Spring Boot Applications with Caching</title>
      <dc:creator>Mehdi Mediani</dc:creator>
      <pubDate>Thu, 11 Sep 2025 10:30:43 +0000</pubDate>
      <link>https://dev.to/mediani-mehdi/boost-your-spring-boot-applications-with-caching-2740</link>
      <guid>https://dev.to/mediani-mehdi/boost-your-spring-boot-applications-with-caching-2740</guid>
      <description>&lt;p&gt;When building modern web applications, performance is a critical factor that directly affects user experience and system scalability. One straightforward but powerful technique to improve performance is caching. Caching helps speed up your app by storing the results of expensive or time-consuming operations, so repeated requests can be served instantly without redundant processing.&lt;/p&gt;

&lt;p&gt;If you’re using Spring Boot, integrating caching is simple yet effective. This post will guide you through the basics of caching in Spring Boot, why it’s important, and a step-by-step example to get you started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Caching?&lt;/strong&gt;&lt;br&gt;
Caching temporarily stores data that is expensive to fetch or compute, such as data from databases, external APIs, or complex calculations. When a request is made, the app first looks in the cache; if the data is found (“cache hit”), it’s returned immediately. If not (“cache miss”), the app performs the operation, stores the result in the cache, and returns it.&lt;/p&gt;

&lt;p&gt;This reduces latency, lowers backend load, and improves responsiveness—especially for data that doesn’t change frequently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enabling Caching in Spring Boot&lt;/strong&gt;&lt;br&gt;
Spring Boot offers a powerful Cache Abstraction that supports various cache providers, including simple in-memory cache, Redis, EhCache, and Caffeine.&lt;/p&gt;

&lt;p&gt;To enable caching, all you have to do is add the @EnableCaching annotation to your main application class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import org.springframework.cache.annotation.EnableCaching;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@EnableCaching
public class MySpringBootApp {
    public static void main(String[] args) {
        SpringApplication.run(MySpringBootApp.class, args);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells Spring to look for caching annotations and enable cache management behind the scenes.&lt;/p&gt;

&lt;p&gt;Caching Method Results with @Cacheable&lt;br&gt;
The easiest way to add caching is by annotating methods that return expensive data with @Cacheable.&lt;/p&gt;

&lt;p&gt;Here’s a practical example demonstrating a simulated slow service fetching user data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Cacheable("users")
    public String getUserById(String userId) {
        simulateSlowService();
        return "UserData for " + userId;
    }

    private void simulateSlowService() {
        try {
            Thread.sleep(3000); // Simulate a 3-second delay
        } catch (InterruptedException e) {
            throw new IllegalStateException(e);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first time you call getUserById("123"), the method executes and returns the data after a simulated delay.&lt;/p&gt;

&lt;p&gt;The result is saved in the "users" cache.&lt;/p&gt;

&lt;p&gt;Subsequent calls with the same "123" parameter return the cached result instantly, avoiding the delay.&lt;/p&gt;

&lt;p&gt;This is extremely helpful when fetching data from remote services or databases that are slow or costly to query.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Caching in Your Applications?&lt;/strong&gt;&lt;br&gt;
Improved Performance: Speeds up response times by avoiding repeated heavy computations or database calls.&lt;/p&gt;

&lt;p&gt;Reduced Backend Load: Cuts down load on databases, APIs, and other services, enabling better scalability.&lt;/p&gt;

&lt;p&gt;Better User Experience: Users receive faster responses, creating smoother interactions.&lt;/p&gt;

&lt;p&gt;Cache Providers Supported by Spring Boot&lt;br&gt;
Spring Boot’s cache abstraction supports multiple providers:&lt;/p&gt;

&lt;p&gt;ConcurrentMapCache: Simple in-memory cache (default).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Redis&lt;/strong&gt;: Distributed, persistent cache suited for clustered environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EhCache&lt;/strong&gt;: Advanced cache with features like persistence and eviction policies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caffeine&lt;/strong&gt;: High-performance, near-optimal in-memory caching.&lt;/p&gt;

&lt;p&gt;For production-ready applications, using Redis or Caffeine offers more control, scalability, and robustness.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
Integrating caching in Spring Boot is easy but impactful. With just a few annotations, you can unlock incredible speed improvements and reduce system load. Start by caching expensive method calls like database fetches or API calls, then explore advanced cache configurations tailored to your needs.&lt;/p&gt;

&lt;p&gt;Give caching a try in your Spring Boot app today and watch performance soar!&lt;/p&gt;




</description>
      <category>springboot</category>
      <category>redis</category>
      <category>java</category>
      <category>database</category>
    </item>
    <item>
      <title>The top JavaScript framework to land a job in 2023</title>
      <dc:creator>Mehdi Mediani</dc:creator>
      <pubDate>Fri, 16 Dec 2022 19:36:33 +0000</pubDate>
      <link>https://dev.to/mediani-mehdi/the-top-javascript-framework-to-land-a-job-in-2023-3do1</link>
      <guid>https://dev.to/mediani-mehdi/the-top-javascript-framework-to-land-a-job-in-2023-3do1</guid>
      <description>&lt;p&gt;JavaScript is a popular programming language that is widely used in web development. It allows developers to create interactive and dynamic websites by adding behaviors to HTML pages.&lt;/p&gt;

&lt;p&gt;In the past few years, there has been a proliferation of JavaScript frameworks that make it easier for developers to build web applications. These frameworks provide pre-built libraries and tools that can help to streamline the development process and improve the performance of web applications.&lt;/p&gt;

&lt;p&gt;So, which JavaScript framework should you learn if you want to get a job in 2023? Here are some top contenders:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;React:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;React is a popular JavaScript library for building user interfaces. It was developed by Facebook and is now maintained by a large community of developers. React allows developers to build reusable components that can be easily shared across different parts of a web application.&lt;/p&gt;

&lt;p&gt;One of the major benefits of React is its virtual DOM (Document Object Model). The virtual DOM is a lightweight in-memory representation of the actual DOM, which allows React to update the DOM more efficiently. This can result in faster and smoother rendering of web pages.&lt;/p&gt;

&lt;p&gt;React is also highly flexible and can be used to build web applications of any size and complexity. It is used by many large companies, such as Facebook, Netflix, and Airbnb, and is a popular choice among developers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Angular:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Angular is a comprehensive JavaScript framework that was developed by Google. It is a full-featured framework that provides a wide range of tools and features for building web applications.&lt;/p&gt;

&lt;p&gt;One of the key features of Angular is its use of components, which allow developers to create reusable and modular pieces of code. Angular also provides a powerful template syntax that makes it easy to build dynamic and interactive user interfaces.&lt;/p&gt;

&lt;p&gt;In addition, Angular has a robust set of built-in features, such as dependency injection, routing, and form validation, that can help to streamline the development process. It is a popular choice among developers and is used by many large companies, such as Microsoft, Intel, and Upwork.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Vue.js:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Vue.js is a progressive JavaScript framework that was created by Evan You, a former Google employee. It is designed to be lightweight and easy to learn, making it a good choice for developers who are new to web development.&lt;/p&gt;

&lt;p&gt;Vue.js is based on a reactive component-based architecture, which allows developers to build web applications that are easy to maintain and scale. It also has a template syntax that is similar to HTML, making it easy for developers to get started with Vue.js.&lt;/p&gt;

&lt;p&gt;In addition, Vue.js has a large and active community of developers, which means that there is a wealth of resources and support available for those who are learning the framework. It is used by many companies, such as Alibaba and Grammarly, and is a popular choice among developers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next.js:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next.js is a JavaScript framework that is built on top of React. It is designed to make it easy for developers to build server-rendered web applications with React.&lt;/p&gt;

&lt;p&gt;One of the key features of Next.js is its automatic code splitting, which allows developers to create web applications that load faster and are more efficient. It also has a powerful routing system that makes it easy to build web applications with multiple pages.&lt;/p&gt;

&lt;p&gt;Next.js is a popular choice among developers who want to build server-rendered web applications with React. It is used by many companies, such as Netflix and Uber, and is a good choice for developers who want to build web applications that are fast and efficient.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;In conclusion, there are many JavaScript frameworks to choose from if you want to get a job in 2023&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>angular</category>
    </item>
  </channel>
</rss>
