helix-cli
helix-cli copied to clipboard
[import] Add host to cache folder structure
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
.