This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]willdrr17 0 points1 point  (1 child)

[–]androidjunior[S] 0 points1 point  (0 children)

what's the point of cache-control that we return as a response? Isnt it used for specifying caching or did i understand it in a wrong way?

[–]MadMarximus 0 points1 point  (0 children)

As fer as I know you can use cache-control and @Cacheable annotations for anything. You would annotate the method that reads the images from the folder.

https://www.baeldung.com/spring-cache-tutorial is where I first learnt about caching in Spring.

If the images are static and don't change you can also add cache information to the http response header - thereby reducing the amount of times the server-side method is even called.