Immune-mediated inflammatory diseases (IMIDs) are associated with cancer risk through mechanisms involving disrupted immune tolerance and dysregulated immune responses. Deng et al. investigated how the timing of IMID diagnosis relative to cancer diagnosis affects patient survival outcomes.