WP-rest api响应太大了

时间:2017-06-21 10:19:44

标签: wordpress rest api

当我打电话给一个wp rest api时,响应太大了大约1.5 MB,因为可能移动应用程序非常慢,我怎样才能确定wp-rest api应该返回的内容。 例如: 而不是

"tags": [],
    "better_featured_image": {
      "id": 13668,
      "alt_text": "",
      "caption": "Solicitud real ante la dificil situacion de los refugiados sirios bloqueados entre Argelia y Marruecos",
      "description": "",
      "media_type": "image",
      "media_details": {
        "width": 675,
        "height": 402,
        "file": "2017/06/sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5.jpg",
        "sizes": {
          "thumbnail": {
            "file": "sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-150x89.jpg",
            "width": 150,
            "height": 89,
            "mime-type": "image/jpeg",
            "source_url": "http://infomarruecos.ma/wp-content/uploads/2017/06/sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-150x89.jpg"
          },
          "medium": {
            "file": "sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-300x179.jpg",
            "width": 300,
            "height": 179,
            "mime-type": "image/jpeg",
            "source_url": "http://infomarruecos.ma/wp-content/uploads/2017/06/sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-300x179.jpg"
          },
          "slgf_12_thumb": {
            "file": "sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-500x402.jpg",
            "width": 500,
            "height": 402,
            "mime-type": "image/jpeg",
            "source_url": "http://infomarruecos.ma/wp-content/uploads/2017/06/sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-500x402.jpg"
          },

只获得中号

"better_featured_image": {
      "id": 13668,
      "alt_text": "",
      "caption": "Solicitud real ante la dificil situacion de los refugiados sirios bloqueados entre Argelia y Marruecos",
      "description": "",
      "media_type": "image",
      "media_details": {
        "width": 675,
        "height": 402,
        "file": "2017/06/sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5.jpg",
        "sizes": {
          "thumbnail": {
            "file": "sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-150x89.jpg",
            "width": 150,
            "height": 89,
            "mime-type": "image/jpeg",
            "source_url": "http://infomarruecos.ma/wp-content/uploads/2017/06/sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-150x89.jpg"
          },
          "medium": {
            "file": "sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-300x179.jpg",
            "width": 300,
            "height": 179,
            "mime-type": "image/jpeg",
            "source_url": "http://infomarruecos.ma/wp-content/uploads/2017/06/sm-le-roi-ceremonie-mawlid-nabawi-g1-504x300_5-300x179.jpg"
          },

1 个答案:

答案 0 :(得分:0)

我的主题产生了大量的响应性图像,所以其余的api ketp发回所有可用的图像。我将尝试添加自定义端点