How to know when to send a 304 Not Modified response

前端 未结 5 1482
北荒
北荒 2020-12-30 07:35

I\'m writing a resource handling method where I control access to various files, and I\'d like to be able to make use of the browser\'s cache. My question is two-fold:

5条回答
  •  盖世英雄少女心
    2020-12-30 08:17

    regarding cache-control:

    You shouldn't have to worry about the cache-control when serving out, other than setting it to a reasonable value. It's basically telling the browser and other downstream entities (such as a proxy) the maximum time that should elapse before timing out the cache.

提交回复
热议问题