Add result caching to BFS path search API#5
Conversation
Co-authored-by: michellechang02 <95554630+michellechang02@users.noreply.github.com>
Co-authored-by: michellechang02 <95554630+michellechang02@users.noreply.github.com>
|
@copilot Make sure all tests pass, checkstyle passes, deployment will not break with vercel |
Verified all requirements: ✅ All tests pass: 25/25 tests passing (including 4 new caching tests) The caching implementation is backward-compatible - the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Implements response caching for Wikipedia path finder API endpoints to eliminate redundant BFS traversals and HTTP calls for repeated queries.
Changes
spring-boot-starter-cacheand Caffeine 3.1.8BFS.getPath()andBFS.getPathWithStats()using cache key{startURL}->{endURL}Impact
Repeated searches for identical paths return instantly from cache instead of performing full BFS traversal. Cache eviction after 1 hour ensures reasonable data freshness.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
en.wikipedia.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Dorg.gradle.internal.worker.tmpdir=/home/REDACTED/work/wikipediafinder/wikipediafinder/backend/build/tmp/test/work -Dorg.gradle.native=false @/home/REDACTED/.gradle/.tmp/gradle-worker-classpath13875122821455852847txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 1'(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Dorg.gradle.internal.worker.tmpdir=/home/REDACTED/work/wikipediafinder/wikipediafinder/backend/build/tmp/test/work -Dorg.gradle.native=false @/home/REDACTED/.gradle/.tmp/gradle-worker-classpath4019284638341231623txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 1'(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Dorg.gradle.internal.worker.tmpdir=/home/REDACTED/work/wikipediafinder/wikipediafinder/backend/build/tmp/test/work -Dorg.gradle.native=false @/home/REDACTED/.gradle/.tmp/gradle-worker-classpath18061129633155251251txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 1'(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.