diff --git a/docker-compose.yml b/docker-compose.yml index 6e41adf..473b887 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,18 +27,6 @@ services: - app-network restart: unless-stopped - static-provider: - image: nginx:alpine - container_name: static-provider - ports: - - "3005:80" # Nginx static files - volumes: - - ./static-files:/static-files - - ./static-provider/nginx.conf:/etc/nginx/conf.d/default.conf - networks: - - app-network - restart: unless-stopped - networks: app-network: driver: bridge diff --git a/reader/src/api.js b/reader/src/api.js index 9c37196..75469fe 100644 --- a/reader/src/api.js +++ b/reader/src/api.js @@ -1,7 +1,8 @@ import axios from "axios"; const API_BASE_URL = "https://api.med.tomastm.com"; -const RESOURCES_BASE_URL = "https://resources.med.tomastm.com"; +//const RESOURCES_BASE_URL = "https://resources.med.tomastm.com"; +const RESOURCES_BASE_URL = "https://api.med.tomastm.com/content"; export const apiInstance = axios.create({ baseURL: API_BASE_URL, diff --git a/resource-provider/server.js b/resource-provider/server.js index 58bc98a..757563d 100644 --- a/resource-provider/server.js +++ b/resource-provider/server.js @@ -97,6 +97,17 @@ app.get( }), ); +// Serve static files with automatic ETag handling +app.use( + "/content", + express.static(STATIC_DIR, { + etag: true, // Enable automatic ETag generation + lastModified: true, // Include Last-Modified header + maxAge: 3600000, // Cache for 1 hour, but always revalidate + immutable: false, // Files can change + }), +); + app.get( "/structure", asyncHandler(async (req, res) => {