This paper investigates volatility connectedness and its application in portfolio optimization, focusing on China's commodity futures market. Using the Time-Varying Parameter Vector Autoregression model, we examine the dynamic connectedness of commodities. In addition to realized volatility, continuous volatility is introduced to reduce distortions caused by intraday jumps. We develop new strategies by (1) incorporating connectedness penalties into the objective function and (2) imposing additional constraints on commodity weights based on net connectedness and degree centrality. These strategies are compared to traditional Markowitz and other benchmark portfolios. Our findings demonstrate that the proposed strategies significantly outperform the benchmark portfolios, particularly during crisis periods. These results are robust to alternative volatility measures, different lag lengths, extended forecast horizons, and various adjustments to key model parameters. Furthermore, the continuous volatility-based strategies outperform their realized volatility counterparts in most cases, offering enhanced stability and reduced short positions. These findings offer valuable insights into the role of connectedness in mitigating systemic risks and optimizing portfolio strategies, emphasizing the necessity of incorporating both covariance and volatility connectedness in the decision-making process.