Skip to content

Document decision to not send cache headers by default in development #55

@evanob

Description

@evanob

I noticed when using Phoenix.Sync locally that the browser wasn't caching requests as I hoped. After digging into the code I discovered that I need to configure send_cache_headers?: true. This worked nicely, but it would be helpful to document this (along with trade-offs and why I might not want to do this).

defp env_defaults(opts, :dev) do
# can't use new tmp dir for every run in dev because the storage
# path must remain consistent between invocations of children(), plug_opts()
# and client()...
# if we want to use emphemeral dir for dev storage then we have to persist
# the storage_dir into the application config.
opts
|> Keyword.put_new(:send_cache_headers?, false)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions