nginx how to use expires with cache-control: public

I’d like to set the following header using nginx:

Cache-Control: public, max-age=604800

My problem is that:

  1. If I use expires, it adds only max-age
  2. If I use add_header Cache-Control public, then it adds only public.
  3. If I use both, then it adds two separate headers, both with the same “key”:
cache-control: max-age=604800
cache-control: public

My questions:

  1. Do I have to worry about anything, or it’s good like this, defined in 2 separate headers?
  2. If it’s not good, how can I combine them into one?
  3. Do I need public at all?

Read more here: Source link