arash16 / nuxt-ssr-cache

Cache middleware for nuxt's SSR rendering.
MIT License
295 stars 64 forks source link

[question] Are there plans to add Cache Headers usage #28

Closed martyzz1 closed 4 years ago

martyzz1 commented 4 years ago

e.g. to support if-modified-since or if-not-match?

In order to do this, the cached page, would also need to store an etag value and/or a last-modified time... Then a request can be compared to the stored values and an appropriate 304 response could be returned...

This would then allow CDN's to cache pages, but have clients still check if the content is updated.

arash16 commented 4 years ago

No, this package aims to not render at all and reduce load on server. if-modified-since requires to actually render the page on subsequent requests, to calculate hash and compare against etag.

Btw such cache headers could be easily provided by a reverse-proxy like nginx.

martyzz1 commented 4 years ago

Hmmm... I might have misunderstood the purpose of this package. I was under the impression this will cache the serverside render of a path/route. Meaning on subsequent page views the path/route can be returned from cache?