{"id":736,"date":"2024-05-07T11:42:26","date_gmt":"2024-05-07T11:42:26","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/how-to-flush-an-image-fromshortpixel-cdn\/"},"modified":"2025-08-27T08:44:32","modified_gmt":"2025-08-27T08:44:32","password":"","slug":"how-to-flush-an-image-fromshortpixel-cdn","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/how-to-flush-an-image-fromshortpixel-cdn\/","title":{"rendered":"How to flush an image or all images from ShortPixel&#8217;s CDN cache?"},"content":{"rendered":"<h2>Flush cache of one image<\/h2>\n<p>\n\t If you are using<br \/>\n\t<a href=\"https:\/\/wordpress.org\/plugins\/shortpixel-adaptive-images\/\" target=\"_blank\" rel=\"noopener\">ShortPixel Adaptive Image<\/a> or <a href=\"https:\/\/wordpress.org\/plugins\/autoptimize\/\" target=\"_blank\" rel=\"noopener\">Autoptimize<\/a> (with the option to optimize images with ShortPixel) and you need to <strong>flush one of the CDN-cached images<\/strong> you can do it like this:<\/p>\n<ol>\n<li>Take the URL of the image in the CDN. For example:&nbsp;\n<pre>https:\/\/cdn.shortpixel.ai\/spai\/w_605+q_lossless+ret_img+to_webp\/https:\/\/blog.shortpixel.com\/wp-content\/uploads\/2019\/06\/web-design-1-1024x734.jpg<\/pre>\n<\/li>\n<li>Copy the URL in your browser and add <code>f_remove+<\/code>&nbsp;after <code>https:\/\/cdn.shortpixel.ai\/spai\/<\/code>, like this<strong>:<\/strong>\n<pre>https:\/\/cdn.shortpixel.ai\/spai\/f_remove+w_605+q_lossless+ret_img+to_webp\/https:\/\/blog.shortpixel.com\/wp-content\/uploads\/2019\/06\/web-design-1-1024x734.jpg<\/pre>\n<\/li>\n<li>Wait 30 seconds, and then the image should be flushed from the CDN cache.<\/li>\n<li>If you are using <a href=\"https:\/\/help.shortpixel.com\/article\/180-can-i-use-a-different-cdn-with-shortpixel-adaptive-images\" target=\"_blank\" rel=\"noopener\">your own CDN<\/a> with ShortPixel Adaptive Images, the previous steps may not work and <strong>you will have to flush your own CDN&#8217;s cache <\/strong>from your CDN control panel as well.<\/li>\n<\/ol>\n<h2>Flush cache of all images (only ShortPixel AI)<\/h2>\n<p>\n\t<em><strong>Note<\/strong>: if you are using Autoptimize, please follow <a href=\"https:\/\/help.shortpixel.com\/article\/247-how-to-flush-cdn-cache-for-autoptimize\" target=\"_blank\" rel=\"noopener\">these instructions<\/a>.<\/em><\/p>\n<p>\n\t If you would like to flush the cache of<br \/>\n\t<strong>all images<\/strong> in our CDN,&nbsp;then the workaround that you can use is the following,&nbsp;equivalent to flushing the whole CDN cache for a website:<\/p>\n<ol>\n<li>Go to your WordPress dashboard<\/li>\n<li>Go to Settings &gt; ShortPixel AI &gt; Behaviour<\/li>\n<li>Look for the field <strong>API URL<\/strong>, and change <code>https:\/\/cdn.shortpixel.ai\/spai<\/code> to <code>https:\/\/cdn.shortpixel.ai\/spai2<\/code>&nbsp;like in the example below:\n<p>\n\t\t<img decoding=\"async\" src=\"https:\/\/kb.shortpixel.com\/wp-content\/uploads\/2025\/08\/file-IORHwoZUqQ.jpg\">\n\t<\/p>\n<\/li>\n<\/ol>\n<p>\n\t Afterwards, if you want again to flush the whole cache you can change <code>https:\/\/cdn.shortpixel.ai\/spai2<\/code> to <code>https:\/\/cdn.shortpixel.ai\/spai3<\/code> and so on &#8211; just increase the number each time you want to flush the cache again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flush cache of one image If you are using ShortPixel Adaptive Image or Autoptimize (with the option to optimize images with ShortPixel) and you need to flush one of the CDN-cached images you can do it like this: Take the URL of the image in the CDN. For example:&nbsp; https:\/\/cdn.shortpixel.ai\/spai\/w_605+q_lossless+ret_img+to_webp\/https:\/\/blog.shortpixel.com\/wp-content\/uploads\/2019\/06\/web-design-1-1024&#215;734.jpg Copy the URL in your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[35],"glossaries":[],"doc_tag":[],"class_list":["post-736","docs","type-docs","status-publish","hentry","doc_category-shortpixel-adaptive-images"],"blocksy_meta":[],"year_month":"2026-04","word_count":295,"total_views":"1305","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin","author_nicename":"admin_mdli53m5","author_url":"https:\/\/kb.shortpixel.com\/author\/admin_mdli53m5\/"},"doc_category_info":[{"term_name":"ShortPixel Adaptive Images","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/shortpixel-adaptive-images\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/comments?post=736"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/736\/revisions"}],"predecessor-version":[{"id":2547,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/736\/revisions\/2547"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=736"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=736"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=736"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}