helix-cli icon indicating copy to clipboard operation
helix-cli copied to clipboard

[import] Add host to cache folder structure

Open kptdobe opened this issue 2 years ago • 0 comments

Run hlx import --cache .cache/ Request http://localhost:3001/index.html?host=https://www.adobe.com then request http://localhost:3001/index.html?host=https://www.google.com.

The second request will get the content from the first one. The cache caches index.html as .cache/index.html as the initial intent was to proxy only one server. But it turns out that we might need to cache from multiple servers for the same import project (especially for images). While name conflict would be rare, it is cleaner to have a clear separation of the host, i.e. add the host name in the file structure (save under something like .cache/www.adobe.com/index.html and .cache/www.google.com/index.html.

kptdobe avatar Oct 10 '22 12:10 kptdobe