In Multi-access Edge Computing (MEC), there exist some dynamic and unknown environment states, such as time-varying wireless channel condition, unreliable computing resource, changing task popularity and so on. In this paper, the autonomic offloading and caching problem for tasks with content data in unknown environment is investigated, and then an Online Joint Optimization Approach (OJOA) is proposed to reduce task delay of each user and increase cache hit size of the edge. Firstly, a joint process with “alternate-decision, parallel-execution” mechanism is designed to integrate offloading procedures and caching procedures and support online learning and autonomic decisions. Then, the offloading problem of each user is formulated as the homogeneous Contextual Multi-Armed Bandit (CMAB) problem, and propose an improved LinUCB based Online Offloading Algorithm (iLinUCB-based OOA) to learn the relationship between task delay and unknown states and select the arm with the lowest delay as offloading decision. For the caching problem on the edge, a Two-Level Change Point Detection based Online Caching Algorithm (TLCPD-based OCA) is developed to make popularity-aware caching decisions, where TLCPD can detect the popularity change and estimate the value of task popularity in real time. Simulation results show that the performance of OJOA is 5.456%∼\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$\sim $$\end{document}7.928% better and only 1.138–5.916% worse than the method with perfect information in terms of average delay, iLinUCB-based OOA performs 14.456–40.998% better than other popular MAB algorithms in terms of cumulative regret, and TLCPD-based OCA performs 0.693–14.896% better than other popular cache replacement algorithms in terms of average hit size.