s/cachable/cacheable
Change-Id: If66c6166c87bfad37e7f3f63d3180c1f652cdecb
This commit is contained in:
@@ -34,7 +34,7 @@ public class RevisionResource implements RestResource, HasETag {
|
|||||||
public static final TypeLiteral<RestView<RevisionResource>> REVISION_KIND =
|
public static final TypeLiteral<RestView<RevisionResource>> REVISION_KIND =
|
||||||
new TypeLiteral<RestView<RevisionResource>>() {};
|
new TypeLiteral<RestView<RevisionResource>>() {};
|
||||||
|
|
||||||
public static RevisionResource createNonCachable(ChangeResource change, PatchSet ps) {
|
public static RevisionResource createNonCacheable(ChangeResource change, PatchSet ps) {
|
||||||
return new RevisionResource(change, ps, Optional.empty(), false);
|
return new RevisionResource(change, ps, Optional.empty(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,11 +52,11 @@ public class RevisionResource implements RestResource, HasETag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private RevisionResource(
|
private RevisionResource(
|
||||||
ChangeResource change, PatchSet ps, Optional<ChangeEdit> edit, boolean cachable) {
|
ChangeResource change, PatchSet ps, Optional<ChangeEdit> edit, boolean cacheable) {
|
||||||
this.change = change;
|
this.change = change;
|
||||||
this.ps = ps;
|
this.ps = ps;
|
||||||
this.edit = edit;
|
this.edit = edit;
|
||||||
this.cacheable = cachable;
|
this.cacheable = cacheable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCacheable() {
|
public boolean isCacheable() {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class ConfigResource implements RestResource {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Default cache control that gets set on the 'Cache-Control' header for responses on this
|
* Default cache control that gets set on the 'Cache-Control' header for responses on this
|
||||||
* resource that are cachable.
|
* resource that are cacheable.
|
||||||
*
|
*
|
||||||
* <p>Not all resources are cacheable and in fact the vast majority might not be. Caching is a
|
* <p>Not all resources are cacheable and in fact the vast majority might not be. Caching is a
|
||||||
* trade-off between the freshness of data and the number of QPS that the web UI sends.
|
* trade-off between the freshness of data and the number of QPS that the web UI sends.
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class Revisions implements ChildCollection<ChangeResource, RevisionResour
|
|||||||
if (id.get().equals("current")) {
|
if (id.get().equals("current")) {
|
||||||
PatchSet ps = psUtil.current(change.getNotes());
|
PatchSet ps = psUtil.current(change.getNotes());
|
||||||
if (ps != null && visible(change)) {
|
if (ps != null && visible(change)) {
|
||||||
return RevisionResource.createNonCachable(change, ps);
|
return RevisionResource.createNonCacheable(change, ps);
|
||||||
}
|
}
|
||||||
throw new ResourceNotFoundException(id);
|
throw new ResourceNotFoundException(id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user