Skip to content

[import] Add host to cache folder structure #2072

Open

Description

@kptdobe

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.

Activity

  1. added
    enhancement
    on Oct 10, 2022
  2. self-assigned this
    on Nov 23, 2022
  3. removed their assignment
    on Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions