Feature #11556

Make AtoM's clipboard work with the Varnish Cache web application accelerator

Added by David Hume almost 3 years ago. Updated 4 days ago.

Status:In progressStart date:09/26/2017
Priority:MediumDue date:
Assignee:José Raddaoui Marín% Done:


Target version:Release 2.7.0
Google Code Legacy ID: Tested version:
Sponsored:Yes Requires documentation:


Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy, designed for content-heavy dynamic web sites as well as heavily consumed APIs. Some AtoM sites with much content and frequent visits have incorporated Varnish for noticeable improvements in response.

Around March 2017 a Varnish site was upgraded, and it was noticed clipboard functionality was not working properly.

One of our developers doing a preliminary investigation noted

Looking into it, I think that the clipboard functionality, as-is, is incompatible with Varnish because it relies on sessions to store clipboard items. Sessions rely on cookies and any page requiring a cookie can't be cached by Varnish (there is a way to do per-user caching with Varnish, but it mostly defeats the purpose of caching as you don't get many cache hits). In order to have AtoM have clipboard functionality that'll work with reverse proxies like Varnish (which we'll need for any site with high traffic) we might need to change it so the clipboard stores items in the browser's storage (i.e. LocalStorage).

Other possible solutions suggested:
  • One alternative that I think it's pretty common is to move the clipboard functionality (or any other non cacheable functionality) to XHR calls that are processed asynchronously once the page loads. If you have all the endpoints using a common namespace, e.g. "/clipboard", then you can set up a rule in Varnish to explicitly disable caching for those.
  • Another possibility is to transform the partial components related to the clipboard to ESI components. Symfony 2 brings ESI by default. In Symfony 1 we could use this plugin: http://www.symfony-project.org/plugins/isicsHttpCachePlugin/0_9_1.


#1 Updated by David Juhasz 3 months ago

  • Description updated (diff)

#2 Updated by José Raddaoui Marín 17 days ago

  • Status changed from New to In progress
  • Assignee set to José Raddaoui Marín
  • Target version set to Release 2.7.0
  • Sponsored changed from No to Yes

Initial pull requests to simulate a Varnish setup in the Docker environment for development:


#3 Updated by José Raddaoui Marín 17 days ago

  • Project changed from AtoM Wishlist to Access to Memory (AtoM)
  • Category set to Clipboard

Also available in: Atom PDF