diff --git a/openlibrary/plugins/openlibrary/js/service-worker.js b/openlibrary/plugins/openlibrary/js/service-worker.js index 84a0ee2fc09..8c3e992c191 100644 --- a/openlibrary/plugins/openlibrary/js/service-worker.js +++ b/openlibrary/plugins/openlibrary/js/service-worker.js @@ -49,6 +49,7 @@ registerRoute( maxEntries: 100, maxAgeSeconds: DAY_SECONDS * 365, }), + cacheableResponses ], }) ); diff --git a/openlibrary/plugins/upstream/code.py b/openlibrary/plugins/upstream/code.py index 95ced4c0949..e5b3cb3568a 100644 --- a/openlibrary/plugins/upstream/code.py +++ b/openlibrary/plugins/upstream/code.py @@ -37,12 +37,13 @@ logger = logging.getLogger('openlibrary.plugins.upstream.code') +# Note: This is done in web_nginx.conf on production ; this endpoint is +# only used in development/gitpod. class static(delegate.page): path = "/images/.*" def GET(self): - host = 'https://%s' % web.ctx.host if 'openlibrary.org' in web.ctx.host else '' - raise web.seeother(host + '/static' + web.ctx.path) + return web.seeother(f'/static{web.ctx.path}') class history(delegate.mode):