Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Question: Is it possible to cache templates outside of the root? #355

Open
thaoms opened this issue May 25, 2018 · 0 comments
Open

Question: Is it possible to cache templates outside of the root? #355

thaoms opened this issue May 25, 2018 · 0 comments

Comments

@thaoms
Copy link

thaoms commented May 25, 2018

I have this folder structure:

  • templates
  • www
    • assets
    • service-worker.js
    • index.php

Because I use a CMS my templates are in the templates folder outside my root, is there a way to just cache http requests, some sort of crawling urls?

export function generateServiceWorker(done) {
	const swPrecache = require('sw-precache');
	const rootDir = 'www';

	swPrecache.write(`${rootDir}/service-worker.js`, {
		staticFileGlobs: [rootDir + '/assets/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}' ,'/agenda/', '/'],
		stripPrefix: rootDir
	}, done);
}

This works fine for my assets but not for my home (/) and agenda (/agenda/ ) urls.
I can't find any clear articles or issues about this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant