0

The scenario is the following:

  1. The request comes on server side.
  2. The server gets the content of a file and modifies it, computing the information that comes from request.
  3. The server sends the response sending the computed information (string) using response.end(content).

Is it possible to cache such response in browser?

Right now, I only cache in browser files (images, CSS & HTML files etc) that are streamed using stream.pipe(response). I use stats = Fs.lstatSync(fileName) to get stats about the file. Caching stuff code is located here.

If the response is just text, I cannot have any stats, because I don't have a file but a long string.

How can I cache text responses? How can I handle them modifications?

Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474

0 Answers0