This paper studies an unmanned aerial vehicle (UAV)-enabled mobile edge network for Cyber-Physical System (CPS), where UAV with fixed-wing or rotary-wing is dispatched to provide communication and mobile edge computing (MEC) services to ground terminals (GTs). To minimize the energy consumption so as to extend the endurance of the UAV, we intend to jointly optimize its 3D trajectory and the task-cache strategies among GTs to save the energies spent on flight propulsion and GT tasks. Such joint trajectory-task-cache problem is difficult to be optimally solved, as it is non-convex and involves multiple constraints. To tackle this problem, we reformulate the optimizing of task offloading and cache into two tractable linear program (LP) problems, and the optimizing of UAV trajectory into three convex Quadratically Constrained Quadratically Program (QCQP) problems on horizontal trajectory, vertical trajectory and flight time of the UAV respectively. Then a block coordinate descent algorithm is proposed to iteratively solve the formed sub-problems through a successive convex optimization (SCO) process. A high-quality sub-optimal solution to the joint problem then will be obtained, after the algorithm converging to a prescribed accuracy. The numerical results show the proposed solution significantly outperforms the baseline solution.