# Energy-Optimized Content Refreshing of Age-of-Information-Aware Edge Caches in IoT Systems
## 1 Introduction
Sending update messages as soon as they are available may not guarantee the timeliness of status updates: the IoT application may receive delayed updates as the messages may congest the network; on the other hand, also reducing the number of transmitted messages may not guarantee the timeliness of status updates--the IoT application may receive outdated messages because of a lack of updates. So, several measures have been analyzed in order to measure the freshness of the cached data [5] and consequently to design a refreshing scheme for the cache. One of the most used is the Age of Information (AoI) metric since it is a suitable metric for describing the freshness at the receiver with respect to the sender. Introduced in [6], the AoI is defined as the elapsed time for an item between the current time and the time the item was generated at the source, i.e., the IoT device [7; 8]. Typically, applications establish a threshold on the value of the AoI; hence, it may be necessary to optimize the system so that the AoI remains below this threshold with a certain probability [9]. This means that at least a fraction of the application requests should receive a data item whose AoI is not larger than the threshold. In a preliminary version of this work [10], we proposed an AoI-aware model-driven cache-management scheme implemented in an edge-based proxy. The proxy can efficiently use a network, computing, and storage resources at the edge, and it can leverage the proximity with the IoT devices to optimize their communication with the IoT applications [11]. Since IoT data typically have a lifetime during which they are useful, we considered a cache-refreshing scheme that associates a lifetime, called refresh window, and expressed in terms of AoI, to each cached item. So, the IoT application requests are sent to the proxy that responds using the cached item if its AoI is smaller than its refresh window; otherwise, it fetches the latest sample from the IoT device, delivers it to the application, and refreshes the cache. This results in a simple polling scheme that can be deployed even on a resource-constrained proxy. We proposed a model for this cache-management scheme that allowed us to derive the closed forms of the average time between two requests that cause a refresh of the cache, i.e., the average time between two polls, the average AoI of the data at the application, and the probability distribution function of AoI. In this work, we leverage our model described in [10] to configure the sampling period of the device and the refresh window of the cache. Our main contributions can be summarized as follows:  
* We define a model-driven optimization problem to set the sampling frequency of the IoT device, and the value of the refresh window of the cache so that the device power consumption is minimized, while the AoI requirement expressed by the IoT application is satisfied. The device power consumption depends on the energy consumed to transmit the messages and the energy consumed to sense the environment. * We solve the optimization problem, and we provide an extensive numerical evaluation of our cache-management scheme, showing the trade-off between minimizing the energy consumed to transmit the messages and the energy consumed to sense the environment. * We evaluate the performance of our cache-management scheme in a realistic environment based on an emulated IoT network using the OMA LightweightM2M ([12; 13]) protocol for IoT device management. In the experiments, we consider a sample scenario composed of an LWM2M Server, i.e., the IoT application, an LWM2M Client, i.e., the IoT device, and an LWM2M Proxy located in between them. The LWM2M Proxy implements the proposed cache management scheme to improve system performance [11], and the refresh window of the cache is selected using the proposed optimized method. We show that the proposed method chooses a refresh window that minimizes the energy cost while satisfying the AoI requirement.