Caching is the same no matter what objects you're using, so the syntax will be the same for npm and python. In the job that builds your .lo files, add the cache information following the suggestions in the docs (https://docs.gitlab.com/ee/ci/caching/). Then for any other pipelines for that branch (or however you set it up) jobs that depend on the .lo files will download them from the cache instead of creating them.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…