Skip to content

Add method of ignoring some fragments and pass them on to the client #7

@andersjanmyr

Description

@andersjanmyr

We have the need for ignoring <esi:include>s for certain hostnames that cannot be handled. The only way I can do this is by hacking the parser. It would be nice to be able to tell the parser to skip some includes.

    match req.get_host() {
        // Tell parser to ignore this esi:include and pass it out as is.
        "host.to.ignore" => ErrSkip(),
        // It results in an infinite loop if pass  format!(r#"<esi:include onerror="continue" src="{}"></esi:include>"#, src);

        // Send all other fragment requests to the main origin
        // with a cache TTL of two minutes (120s)
        _ => Ok(req.with_ttl(120).send("origin_0")?)
      }

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions