Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement request variants handling #9

Closed
chesio opened this issue Sep 20, 2018 · 2 comments
Closed

Implement request variants handling #9

chesio opened this issue Sep 20, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@chesio
Copy link
Owner

chesio commented Sep 20, 2018

Motivation: every page on sites, where Cookie Notice plugin is active, has two variants: one with cookie notice banner and one without it. This way, only part of visitors can be served from cache: either those who haven't accepted cookie policy yet or those who did.

Idea: store alternative page variants (HTML responses) in directories with #variant-name appended to the directory name. This should be safe, as # will never be part of request URI (and thus default directory name), but is a perfectly legal character in directory name under both Unix/Linux and Windows.

@chesio chesio added the enhancement New feature or request label Sep 20, 2018
@chesio chesio self-assigned this Sep 20, 2018
@chesio chesio changed the title Implement page variants caching Implement page variants handling Sep 20, 2018
@chesio
Copy link
Owner Author

chesio commented Sep 20, 2018

Note: The feature would require URI to directory relationship to change from 1:1 to 1:N (one URI can be cached in multiple directories). Not a big problem now, but should be considered, because #4 might be implemented one day and cache API supports deletion of single URI already.

@chesio chesio closed this as completed in 393489e Sep 20, 2018
@chesio
Copy link
Owner Author

chesio commented Sep 20, 2018

The final implementation did not include variant name in directory names, but in file names. It seemed more clean and was quite straight-forward to implement as the implementation aligns well with the handling of gzipped variants. Also, the 1:1 relationship between request URI and directory is retained.

@chesio chesio changed the title Implement page variants handling Implement request variants handling Sep 20, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant