Closed Bug 1606276 Opened 1 year ago Closed 10 months ago

Spocs from cache load optimization


(Firefox :: New Tab Page, enhancement, P1)




Firefox 78
Tracking Status
firefox78 --- verified


(Reporter: thecount, Assigned: thecount)



(1 file, 1 obsolete file)

Small cleanup that can happen, might also reduce load time for cache loads.

Right now if we load spocs data from fresh or cache, we then filter blocked stories and remove frequency capped spocs from those results.

If we instead, updated spocs cache as stories got blocked/seen we wouldn't need to do it again from cached loads as it would already be up to date. We would only need to update fresh spocs.

This doesn't apply to feeds, this has a slightly more complex handling because it's got placements, frequency capping, and flight id migration, so the code paths are separate and different currently. See bug 1606277

Assignee: nobody → sdowne
Iteration: --- → 74.1 - Jan 6 - Jan 19
Priority: -- → P1

To test that we haven't regressed:

  1. Set browser.newtabpage.activity-stream.asrouter.devtoolsEnabled to true
  2. Open about:newtab#devtools-ds
  3. Ensure "show_spocs" is checked
  4. Verify you have some spocs showing. You've verified a fresh load.
  5. Restart the browser, and reloading about:newtab#devtools-ds. You've now triggered a cache load.
  6. Ensure you still have spocs showing.
  7. Click "refresh cache" or "expire cache" which ever you see.
  8. Refresh about:newtab#devtools-ds
  9. Ensure you still have spocs, you've just verified another fresh load.

This is making sure spocs still load as expected from cache or fresh. Technically less work is happening to produce the same results.

You can also test blocking and frequency capping of spocs user actions:


  1. Block a spoc, reload the browser, expect the spoc to still be blocked.

This verifies a block happened, and a cache load still produced the update.

Frequency capping

  1. Refresh a newtab until a spoc is no longer shown, roughly 10 views.
  2. Reload the browser, spoc should still be gone.
Iteration: 74.1 - Jan 6 - Jan 19 → 74.2 - Jan 20 - Feb 09
No longer blocks: pocket-newtab
Iteration: 74.2 - Jan 20 - Feb 09 → ---
Priority: P1 → P2

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:thecount, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(sdowne)

It bit rotted quite a bit over allhands, and I needed to do a pretty gnarly rebase which lowered my confidence of my previous testing and QA of the patch, and also the previous r+.

I did the rebase and things seemed to work, but I need to find more time to do thorough testing on it.

I imagine I'll get to it during 76.

Flags: needinfo?(sdowne)
Priority: P2 → P1
Attachment #9118014 - Attachment is obsolete: true
Pushed by
Spocs from cache load optimization r=gvn
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 78

I have verified that spocs still load as expected from cache or refresh by following the steps in comment 2 using the latest Firefox Nightly 78.0a1 (Build ID: 20200527213321) on Windows 10 x64, macOS 10.15, and Ubuntu Linux 18.04 x64.

You need to log in before you can comment on or make changes to this bug.