我们正在一个相当大的网站上工作,该网站将在启动时包含大约8000页。最初,我们计划静态生成所有页面,但是为了使构建时间易于管理(现在以及随着添加更多页面),现在似乎不太可行。现在的问题是,如果我们要限制应该静态生成的页面的数量,应该使用什么标准来识别应该使用哪些标准以及应该通过后备选项(const axios = require("axios");
/**PayPal main class, this class will setup PayPal credentials when instance */
class PayPal {
setupEnvironment = async () => {
// Sets base URL to send requests
this.setAPIDomain();
// Sets PayPal endpoints
this.setPayPalEndpoints();
// Sets API Keys
await this.setAPIKeys();
}
setAPIKeys = async () => {
const paypal_credentials = this.getPayPalCredetials();
const { client_id, client_secret } = paypal_credentials;
try {
const response = await axios({
method: "post",
url: this.endpoints.get_access_token,
data: "grant_type=client_credentials",
headers: {
"Accept-Language": "en_US",
"Accept": "application/json"
},
auth: {
username: client_id,
password: client_secret
},
});
this.access_token = response.data.access_token;
} catch (error) {
console.log(error.response.data);
throw new Error(error.response.data.error_description);
}
}
}
class Customer extends PayPal() {
async init = () => {
await this.setupEnvironment();
// More init code
}
}
const paypal_gateway = new Customer();
await paypal_gateway.init(); // <- code inside another async function
处理的标准)? 。 next.js documentation提到了fallback: true
页,但是对于应该如何确定该子集并不清楚。