Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Instead of querying the database each time a page is loaded, a cached version of the page can be served, provided the user is logged out. Since version 1.6, VIVO supports HTTP caching directly. To enable, uncomment the "http.createCacheHeaders = true" line in runtime.properties:

 

Code Block
titleruntime.properties
# Tell VIVO to generate HTTP headers on its responses to facilitate caching the 
# profile pages that it creates. 
#
# For more information, see this wiki page: 
# https://wiki.duraspace.org/display/VIVO/Use+HTTP+caching+to+improve+performance
#
# Developers will likely want to leave caching disabled, since a change to a
# Freemarker template or to a Java class would not cause the page to be 
# considered stale.
#
  http.createCacheHeaders = true

...

The above configuration was provided by Ted Lawless. Restart Apache and Tomcat. Large pages should now load significantly faster for logged-out users.

You can verify http caching is occurring by looking in the directory specified as CacheRoot and seeing if files are being added. You can also use your browser's debugging tools, like Firebug or Chrome debug tools, to inspect the HTTP status code of the response for a profile page. Cached . In Chrome, enable Developer Tools (View > Developer > Developer Tools, or ⌥⌘I) and select 'Network' on the pane that appears. Cached pages will return a 304 "Not Modified" response. 

...