Skip to content
Snippets Groups Projects
Commit 32247b84 authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

Merge branch 'malowe/main/http-caching' into 'main'

update: update to sdk 1.1.7, add http caching to endpoints

See merge request !61
parents c3ff933b e1d69e48
No related branches found
No related tags found
1 merge request!61update: update to sdk 1.1.7, add http caching to endpoints
Pipeline #59200 passed
......@@ -15,7 +15,7 @@
<quarkus.platform.version>3.8.6</quarkus.platform.version>
<surefire-plugin.version>3.1.2</surefire-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<eclipse-api-version>1.1.6</eclipse-api-version>
<eclipse-api-version>1.1.7</eclipse-api-version>
<auto-value.version>1.10.4</auto-value.version>
<org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
<sonar.sources>src/main</sonar.sources>
......
......@@ -23,6 +23,8 @@ import org.eclipsefoundation.caching.service.CachingService;
import org.eclipsefoundation.cve.model.CveData;
import org.eclipsefoundation.cve.namespace.CveUrlParameterNames;
import org.eclipsefoundation.cve.service.CveService;
import org.eclipsefoundation.http.namespace.CacheControlCommonValues;
import org.jboss.resteasy.reactive.Cache;
import com.rometools.rome.feed.synd.SyndContent;
import com.rometools.rome.feed.synd.SyndContentImpl;
......@@ -61,6 +63,7 @@ public class CveResource {
CachingService cache;
@GET
@Cache(maxAge = CacheControlCommonValues.SAFE_CACHE_MAX_AGE)
public Response get(@QueryParam(CveUrlParameterNames.PROJECT_NAME_PARAM_NAME) String projectName) {
List<CveData> out;
if (StringUtils.isNotBlank(projectName)) {
......@@ -75,6 +78,7 @@ public class CveResource {
@GET
@Path("rss.xml")
@Produces(MediaType.APPLICATION_XML)
@Cache(maxAge = CacheControlCommonValues.SAFE_CACHE_MAX_AGE)
public Response getCveRSSFeed(@QueryParam(CveUrlParameterNames.PROJECT_NAME_PARAM_NAME) String projectName) {
CacheWrapper<String> cachedFeed = cache.get("all", null, String.class, () -> {
SyndFeed feed = new SyndFeedImpl();
......@@ -127,6 +131,7 @@ public class CveResource {
@GET
@Path("/{id}")
@Cache(maxAge = CacheControlCommonValues.AGGRESSIVE_CACHE_MAX_AGE)
public Response getById(@PathParam("id") String id) {
Optional<CveData> cve = cveSource.getCve(id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment