XML configuration support for RFC 5861
This commit adds the XML+XSD configuration part of the RFC 5861 Cache-Control directives added in Spring's `CacheControl`. Issue: SPR-13841
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -242,6 +242,14 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
|
||||
if (element.hasAttribute("s-maxage")) {
|
||||
cacheControl = cacheControl.sMaxAge(Long.parseLong(element.getAttribute("s-maxage")), TimeUnit.SECONDS);
|
||||
}
|
||||
if (element.hasAttribute("stale-while-revalidate")) {
|
||||
cacheControl = cacheControl.staleWhileRevalidate(
|
||||
Long.parseLong(element.getAttribute("stale-while-revalidate")), TimeUnit.SECONDS);
|
||||
}
|
||||
if (element.hasAttribute("stale-if-error")) {
|
||||
cacheControl = cacheControl.staleIfError(
|
||||
Long.parseLong(element.getAttribute("stale-if-error")), TimeUnit.SECONDS);
|
||||
}
|
||||
return cacheControl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user