title: Cache HTTP requests in a serverless environment
body: <p>I have an serverless lambda which does the following:</p>
  <ul>
  <li>Start with a set of <code>ids</code> in the query (<code>example.com?ids=a,b,c</code>)</li>
  <li>Does HTTP request to another webservice (based on the given <code>ids</code>) which I do not control</li>
  <li>Renders the website based on the other webservice response</li>
  </ul>
  <p>All works, no issues so far.</p>
  <p>Today I introduced a new UI for my website. The user can toggle between &quot;a tableview&quot; and &quot;a listview&quot;.
  Because those differents views can also be controlled via (another) query paramter, I do a simple &quot;redirect&quot; to my own website. Assuming I'm looking currently at the tableview, for the &quot;show listview&quot; textfield I have a simple <code>&lt;a href=&quot;example.com?ids=a,b,c&amp;view=list&quot;&gt;[...]&lt;a&gt;</code>.</p>
  <p>This redirect leads, of course, to another call to the &quot;other webservice&quot;. Even if I can be pretty sure that the content haven't change since my last call (just a few seconds/minutes ago).</p>
  <p>My question is:</p>
  <p>Can I somehow cache the HTTP requests from my lambda so that we won't do the call again?
  I'm somewhat aware of the <code>Cache-Control</code> headers, but since it is an serverless environment it could (and probably will?! I don't know but I don't even care ) another machine without this cache. And therefore it will not be an cache hit and will do the requests anyways.</p>
  <p>Please don't answer with solutions like &quot;Use JavaScript for changing the UI&quot;. I'm aware that this is possible, but my main question is just how (and even if I can) cache such requests in a serverless environment.</p>
  <p>Thanks in advance!</p>