Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41c3e0f2 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Introduce a 1 day cache for Exodus

parent c03186c8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ package foundation.e.apps.data.exodus

import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Path
import retrofit2.http.Query

@@ -9,11 +10,14 @@ interface ExodusTrackerApi {

    companion object {
        const val BASE_URL = "https://exodus.ecloud.global/api/"
        const val CACHE_DURATION_SECONDS = 86400 // 1 day
    }

    @Headers("Cache-Control: public, max-age=$CACHE_DURATION_SECONDS")
    @GET("trackers")
    suspend fun getTrackerList(@Query("date") date: String): Response<Trackers>

    @Headers("Cache-Control: public, max-age=$CACHE_DURATION_SECONDS")
    @GET("search/{appHandle}/details")
    suspend fun getTrackerInfoOfApp(
        @Path("appHandle") appHandle: String,