# Handling Etags on the client side

**URL:** <https://discuss.kotlinlang.org/t/handling-etags-on-the-client-side/18465>\
**Category:** Web Development\
**Created:** [July 17, 2020, 4:41am UTC](https://discuss.kotlinlang.org/t/handling-etags-on-the-client-side/18465 "2020-07-17T04:41:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matto](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@matto](https://discuss.kotlinlang.org/u/matto)\
**Post date:** [July 17, 2020, 4:41am UTC](https://discuss.kotlinlang.org/t/handling-etags-on-the-client-side/18465/1 "2020-07-17T04:41:19Z")

</div>

I’m trying to find some ideas on how to handle Etags on the client-side from within Webflux http client builder( **WebClient.Builder** )  
Wondering if it would build the response based on the server’s response(cached payload if 304 or a new one if 200).  
Something similar to the way that Retrofit2 does. Anyone?  
e.g.

> public static Retrofit getAdapter(Context context, String baseUrl) {  
> OkHttpClient.Builder builder = new OkHttpClient().newBuilder();  
> builder.cache(  
> new Cache(context.getCacheDir(), CACHE\_SIZE\_BYTES));  
> OkHttpClient client = builder.build();  
> Retrofit.Builder retrofitBuilder = new Retrofit.Builder();  
> retrofitBuilder.baseUrl(baseUrl).client(client);  
> return retrofitBuilder.build();  
> }

**The _Last-Modified_ headers or _Etags_ will be automatically used depending on the servers responses**  
**On a 304 status, Retrofit2 and OkHttp3 will pretend this response was equal to the last response; the cached response is returned**
