Implementing an HTTP server is one of the main purposes of Java EE. Using the Servlet API, JAX-RS, or even JAX-WS, you can easily expose data over HTTP without caring for the transport.
However, HTTP defines a caching mechanism that is interesting to take into account in order to optimize the client's behavior.
The common communication with your server will look as follows:
The server makes a request and the client sends back some data in headers and a payload (which can be huge). On the previous schema, it is a JSON payload, but don't forget that your web applications will probably also serve images and other sorts of resources, which get big very quickly.
To avoid having to do it each and every time, even when nothing is changed (a picture will not change very often in general), the HTTP specification defines a set of headers that help identify the...