spring.resources.cache-period spring.resources.chain.gzipped作废解决办法

本文介绍了Spring Boot中资源缓存配置的更新,包括废弃的配置项spring.resources.cache-period和spring.resources.chain.gzipped,建议使用spring.resources.cache.period和spring.resources.chain.compressed作为替代。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

根据spring-boot-autoconfigure-2.1.1.RELEASE.jar下的spring-configuration-metadata.json查询得到的

作废了按住Ctrl点进去,搜索关键字就能看到下面的两个了

你换成spring.resources.cache.period和 spring.resources.chain.compressed用就好了

    {
      "name": "spring.resources.cache-period",
      "type": "java.lang.Integer",
      "description": "Cache period for the resources served by the resource handler. If a duration suffix is not specified, seconds will be used.",
      "deprecated": true,
      "deprecation": {
        "level": "error",
        "replacement": "spring.resources.cache.period"
      }
    },
 {
      "name": "spring.resources.chain.gzipped",
      "type": "java.lang.Boolean",
      "description": "Whether to enable resolution of already gzipped resources. Checks for a resource name variant with the \"*.gz\" extension.",
      "deprecated": true,
      "deprecation": {
        "level": "error",
        "replacement": "spring.resources.chain.compressed"
      }
    },

 

The use of configuration keys that have been renamed was found in the environment: Property source 'applicationConfig: [classpath:/application.yml]': Key: spring.redis.database Line: 18 Replacement: spring.data.redis.database Key: spring.redis.host Line: 16 Replacement: spring.data.redis.host Key: spring.redis.password Line: 19 Replacement: spring.data.redis.password Key: spring.redis.port Line: 17 Replacement: spring.data.redis.port Key: spring.resources.cache.period Line: 33 Replacement: spring.web.resources.cache.period Key: spring.resources.chain.cache Line: 37 Replacement: spring.web.resources.chain.cache Key: spring.resources.chain.gzipped Line: 35 Replacement: spring.web.resources.chain.compressed Property source 'Config resource 'class path resource [application.yml]' via location 'optional:classpath:/'': Key: spring.redis.database Line: 18 Replacement: spring.data.redis.database Key: spring.redis.host Line: 16 Replacement: spring.data.redis.host Key: spring.redis.password Line: 19 Replacement: spring.data.redis.password Key: spring.redis.port Line: 17 Replacement: spring.data.redis.port Key: spring.resources.cache.period Line: 33 Replacement: spring.web.resources.cache.period Key: spring.resources.chain.cache Line: 37 Replacement: spring.web.resources.chain.cache Key: spring.resources.chain.gzipped Line: 35 Replacement: spring.web.resources.chain.compressed Each configuration key has been temporarily mapped to its replacement for your convenience. To silence this warning, please update your configuration to use the new keys. 什么问题
最新发布
08-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值