Versions Compared

Key

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

The HTTP resource and the related File Backed HTTP Resource allow configuration to be retrieved from an web server.  In contrast to the Spring UrlResource, significant control of the underlying Apache HttpClient is available.  For instance the following can be controlled controlled:

  • In-memory or file backed caching.  This caching is at the HTTP client level.  It allows a reduction of the HTTP traffic since data is only loaded when it has gone out of date.  These caches do not survive not survive the lifetime of the HttpClient, and in particular they are not available when the IdP restarts.
  • Connection timeouts and other connection-related configuration.
  • Proxy information
  • Security and certificate information.
  • and so on

...

A resource which will be supplied from an on disk cache (suitable for multiple or large files) for as long as the file on the webserver does not change.  If the webserver becomes unavailable the last used contents of the file will be returned (even if that was in a previous IdP lifetime)

Code Block
languagexml
<bean id="fileClient" 
      class="net.shibboleth.idp.profile.spring.relyingparty.metadata.FileCachingHttpClientFactoryBean"
      p:maxCacheEntries="3000"
      p:cacheDirectory="/var/shibboleth/caches/httpcache"/>
        
<bean id="fileResource" class="net.shibboleth.ext.spring.resource.FileBackedHTTPResource"
      c:client-ref="fileClient" 
      c:url="http://example.org/path/to/file.xml" 
      c:resource="/var/shibboleth/caches/resourcecache/file.xml"/>

...