Adjustments for client hints support #44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
With matomo-org/matomo#18843 support for client hints will be introduced in Matomo.
As this plugin currently only caches based on the useragent, the additional client hint details would currently be lost.
On the other side it won't make sense to create cache entries based on the useragent and the client hints, as client hints won't be included in any log files.
So I've decided the extend the parser classes used for parsing browser and operating system. The cache entries are still stored based on the useragent. But if client hints are provided, the extended parsers will be used to enrich the results with the client hints.
As parsing the client hints is quite fast and still rarely sent at all, I don't think it's needed to included that in the caching.
Note: The changes in this PR should also work with Matomo versions nor using DeviceDetector with client hints. It therefor shouldn't be needed to increase the minimum required version.
Review