-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore requests that are not eligible for FPC #37
base: develop
Are you sure you want to change the base?
Conversation
Hey @sdesmet - I wouldn't implement this change as is as I think it's also of value to know your hit rate for ALL requests. It's also interesting to know amongst cache-able pages only. I've filtered by route in my dashboarding tool to get that data. I would consider adding an additional base param from the param provider to say whether or not the page is cacheable so instead of filtering for a set of routes you can just filter for that param to get your hit rate amongst cache-able pages only. |
Hi @mpchadwick I think the extra param in the event payload would make for a great addition. Something we could filter on in New Relic Insights. We do have some custom modules that introduce new cache-able routes into FPC and I wouldn't need to know those to get a base line "hit vs misses" monitoring going on any site we run. I'll see if I have some time to change the PR to follow that concept. Thanks |
9ce3ff8
to
117cb52
Compare
I've added the cacheable param. Please review. Cheers |
$subprocessor = $processor->getMetadata('cache_subprocessor'); | ||
|
||
return $subprocessor !== null && $processor->canProcessRequest($request); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code will only execute for cache misses or partials meaning that the cacheable param will not be added for hits. For hits the observer won't fire and the tracking is handled by Mpchadwick_PageCacheHitRate_Model_Processor
.
Both consult Mpchadwick_PageCacheHitRate_Model_Tracker_ParamProvider::baseParams
which is probably where this value should come from. That way you only need to write the logic once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Accidentally selected "Approve". Meant to do "Request changes".
Hi Max,
Thanks for your great extension and very informative talk on NomadMage on the subject.
I've noticed something though while testing the module. All requests contribute to the hit/miss/partial rate, for instance also the cart page. In some way, I believe that skews the results. Magento out-of-the-box only supports FPC for certain "subprocessors" and the cart page will never be cached, so it's always going to add to the miss total. I'm mostly interested in having the stats on how the FPC is working for pages that should be cached, not the ones that I know will never be cached.
The change in this PR filters out any requests (routes) that would never be cached.
Cheers,
Steve