IdleFish Double 11 2023: Frontend Engineering Challenges and Solutions
During IdleFish’s 2023 Double 11 promotion, engineers tackled massive traffic spikes by running feature‑flag, launch‑side, and mitmproxy‑based disaster‑recovery rehearsals, boosted performance with increased first‑screen modules, CSS‑only animations, pre‑fetching and offline caching, introduced a PHA container for seamless tab switching, and optimized deep‑link handling for external channels, while planning further SSR and stability automation.
During the 2023 Double 11 promotion, IdleFish (Alibaba's second‑hand marketplace) expanded from a sell‑only platform to a buy‑and‑sell experience, presenting significant engineering challenges for the client side.
Key challenges included ensuring stability under massive traffic spikes, delivering a seamless multi‑venue (会场) experience, and handling external traffic from Taobao, Alipay, and WeChat.
Stability guarantees involved three types of rehearsals:
Feature‑flag self‑check to validate AB switches under high PV pages.
Launch‑side (拉端) rehearsals to simulate both installed and fresh‑install scenarios from external apps.
Disaster‑recovery drills using mitmproxy to strip random response fields and verify that the app gracefully falls back to cached data without crashing.
The following mitmproxy addon was used to modify responses during the drills:
#!/usr/bin/python3
import json
from mitmproxy import ctx, http
from mitmproxy.net.http.http1.assemble import assemble_request
class IdleFishModifyResponse:
def __init__(self):
self.num = 0
self.whitelist = ['${请求 url1}','${请求 url2}']
def response(self, flow):
inWhiteList = False
for white in self.whitelist:
if white in flow.request.pretty_url:
inWhiteList = True
if inWhiteList:
jsonObj = json.loads(flow.response.content.decode('utf-8'))
ctx.log.info("delete index=" + str(self.num))
ctx.log.info("before modify:" + flow.request.pretty_url)
ctx.log.info(flow.response.content.decode('utf-8'))
if isinstance(jsonObj['data'], list):
self.removeOne(jsonObj['data'])
elif isinstance(jsonObj['data'], dict):
self.removeOne([jsonObj['data']])
flow.response.content = json.dumps(jsonObj).encode('utf-8')
ctx.log.info("after modify:" + flow.request.pretty_url)
ctx.log.info(flow.response.content.decode('utf-8'))
self.num = self.num + 1
def removeOne(self, objList: list):
return self.dfs(objList, 0)
def dfs(self, objList: list, index):
children = []
for obj in objList:
if isinstance(obj, dict):
for key in obj:
if index == self.num:
obj.pop(key, None)
return True
children.append(obj[key])
index = index+1
if isinstance(obj, list) and len(obj) > 0:
children.append(obj[0])
if len(children) == 0:
return False
return self.dfs(children, index)
addons = [
IdleFishModifyResponse()
]Performance optimization focused on increasing the number of modules returned in the first‑screen request from 4‑6 to 10, adding pre‑fetch and offline caching, and replacing heavy animation libraries with CSS‑only implementations, reducing module size to under 30 KB.
The PHA (Progressive Hybrid App) container was introduced to enable in‑page tab switching without full page reloads, improving user experience across multiple sub‑venues.
External channel (端外) optimizations covered deep‑link handling for HarmonyOS and Douyin, Universal Link support, and enhanced data reporting for channel‑level attribution.
Future work includes deeper integration of SSR, further PHA‑container refinements, and continued stability automation.
Xianyu Technology
Official account of the Xianyu technology team
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.