Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sdesmet
Copy link

@sdesmet sdesmet commented Apr 10, 2018

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

@mpchadwick
Copy link
Owner

mpchadwick commented Apr 11, 2018

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.

@sdesmet
Copy link
Author

sdesmet commented Apr 12, 2018

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

@sdesmet sdesmet force-pushed the develop branch 2 times, most recently from 9ce3ff8 to 117cb52 Compare April 14, 2018 16:26
@sdesmet
Copy link
Author

sdesmet commented Apr 14, 2018

@mpchadwick

I've added the cacheable param. Please review.

Cheers

$subprocessor = $processor->getMetadata('cache_subprocessor');

return $subprocessor !== null && $processor->canProcessRequest($request);
}
Copy link
Owner

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.

Copy link
Owner

@mpchadwick mpchadwick left a 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants