A method for compressing a content name in an information-centric network, named-data network, or content-centric network, comprising: constructing, by the controller, a network topology tree according to a topology information table, wherein the network topology tree is tree-structured, a first content router is set at a first-layer node of the network topology tree, an N th content router directly and physically connected to an M th content router is set at an N th -layer node of the network topology tree, M+1=N, N is an integer greater than 1, the topology information table is stored in the controller, and a topology structure between content routers is stored in the topology information table; determining, by the controller, a content router other than the first content router on a subtree in the network topology tree as a first network node, wherein the first network node is connected to the first content router via a first port of the first content router; constructing (101, 403), by a controller, a content name tree according to content names in a content database, wherein the content name tree is tree-structured, a first-level node of the content name tree stores a first-level prefix of a content name, an N th -level node of the content name tree stores prefixes of at least first N levels of the content name, and N is an integer greater than 1; and when determining, by the controller, that a first content name stored in each M th -level node in the content name tree is corresponding to the first network node, compressing (102, 404) the first content name stored in the M th -level node into a second content name stored in a father node of the M th -level node, wherein each M th -level node is connected to a same father node, the first network node comprises at least one content router, M is an integer greater than 1, and M is less than or equal to N. constructing, by the controller, a network topology tree according to a topology information table, wherein the network topology tree is tree-structured, a first content router is set at a first-layer node of the network topology tree, an N th content router directly and physically connected to an M th content router is set at an N th -layer node of the network topology tree, M+1=N, N is an integer greater than 1, the topology information table is stored in the controller, and a topology structure between content routers is stored in the topology information table; determining, by the controller, a content router other than the first content router on a subtree in the network topology tree as a first network node, wherein the first network node is connected to the first content router via a first port of the first content router; constructing (101, 403), by a controller, a content name tree according to content names in a content database, wherein the content name tree is tree-structured, a first-level node of the content name tree stores a first-level prefix of a content name, an N th -level node of the content name tree stores prefixes of at least first N levels of the content name, and N is an integer greater than 1; and when determining, by the controller, that a first content name stored in each M th -level node in the content name tree is corresponding to the first network node, compressing (102, 404) the first content name stored in the M th -level node into a second content name stored in a father node of the M th -level node, wherein each M th -level node is connected to a same father node, the first network node comprises at least one content router, M is an integer greater than 1, and M is less than or equal to N.