Menu

ensuring that clients will not try to cache

2002-03-14
2002-03-14
  • Dave Cooper

    Dave Cooper - 2002-03-14

    Does anyone know the best way to ensure that the client will not cache the page at all, to ensure all pages will be freshly loaded from the server on each request? I seem to remember some kind of pragma no-cache header or something, but i don't see direct reference for how to do that with allegroserve...

    Thanks,

    -dave

     
    • Dave Cooper

      Dave Cooper - 2002-03-14

      Ok, following up on my own post: I looked at the http 1.1 specification, and apparently one should do the following between with-http-response and with-http-body, to prevent all caching:

      (with-http-response (req ent)
          ...

         (setf (reply-header-slot-value req :cache-control)
             "no-cache")
         (setf (reply-header-slot-value req :pragma)
            "no-cache")
          ...

           (with-http-body (req ent)
            ...  ))

      The "pragma: no-cache" is for backward compatibility with http 1.0 clients - the new way is "cache-control: no-cache."

      -dave

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.