Skip to content

Is it necessary to force no-cache for getServerSideProps? #156

Closed
@nikshenoy

Description

@nikshenoy

https://github.com/netlify/next-on-netlify/blob/a73045f878b47f7fac8d70ceafd7e0ca39759d15/lib/templates/netlifyFunction.js#L29

It seems like the current code is forcing no-cache to be set on Netlify function calls (including getServerSideProps). I think this makes sense in a lot of cases, however we just had a use case where it would be safe to cache the results of that server-side execution for some period of time and we wanted to express that by setting the Cache-Control setting in the getServerSideProps method. This seems to be problematic because next-on-netlify adds an additional no-cache header which conflicts with ours. Is this something that could be conditional on an existence check for the header?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions