我有一个Google Appengine Java应用程序,我用它来托管一个简单的静态网站。
我的.html、.css、.jpg文件放在war目录中。这是我的web.xml
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>下面是我的appengine-web.xml
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>myapp</application>
<version>5</version>
<!--
Allows App Engine to send multiple requests to one instance in parallel:
-->
<threadsafe>true</threadsafe>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
<static-files>
<include path="/**.png" expiration="7d" />
<include path="/**.gif" expiration="7d" />
<include path="/**.jpg" expiration="7d" />
<include path="/**.jpeg" expiration="7d" />
<include path="/**.tif" expiration="7d" />
<include path="/**.tiff" expiration="7d" />
<include path="/**.svg" expiration="7d" />
<include path="/**.eot" expiration="7d" />
<include path="/**.ttf" expiration="7d" />
<include path="/**.woff" expiration="7d" />
<include path="/**.webp" />
<include path="/**.ico" />
<include path="/**.html" />
<include path="/**.css" />
<include path="/**.js" />
<include path="/**.zip" />
<include path="/**.msi" />
<include path="/**.exe" />
<include path="/**.xml" />
<include path="/**.txt" />
<include path="/**.htc" />
</static-files>
</appengine-web-app>我想做webp版本的图像,只要有可能。我该怎么做呢?
我做了一个简单的实验。我的war目录中有file.jpg和相应的file.webp。我有一个引用file.jpg的home.html页面。当我在Google Chrome上访问home.html时--提供的是jpg而不是webp。
https://stackoverflow.com/questions/38118571
复制相似问题