Opened 10 years ago

Closed 10 years ago

#12146 closed Bug (fixed)

Files from CKEditor CDN not cached

Reported by: William Gross Owned by:
Priority: Normal Milestone:
Component: Performance Version: 4.4.2
Keywords: Cc:

Description

If you follow the instructions at cdn.ckeditor.com to put CKEditor on a page using the new CDN, ckeditor.js and other files will be requested *every single time* your page is loaded. This is happening because there is no HTTP cache-control header included with the CKEditor files being served from the CDN. Without the cache-control header, web browsers have no choice but to reissue GET requests for the files every single time.

To reproduce:

  1. Follow the instructions at cdn.ckeditor.com to create a page that uses CKEditor via the CDN.
  1. Navigate to the page in a web browser. Verify that the CKEditor on your page is working. This proves that your browser has downloaded ckeditor.js and some of the other CKEditor files from the CDN.
  1. Open up your browser's "F12 developer tools" and turn on the request tracing feature. In Firefox, this is called the Network tab.
  1. Put your cursor in the browser's address bar. Hit the Enter key to request the page again.
  1. Notice the GET requests for ckeditor.js and possibly other files. The response code will probably be "304 Not Modified", which means the files were not re-downloaded in their entirety (which is good), but were nevertheless requested again from CloudFront.

The correct behavior would be for the CKEditor files to be retrieved from the local cache without any GET requests to CloudFront. This should be an easy fix: just configure CloudFront to send cache-control headers when the files are requested. Since you put each new version of CKEditor in a new directory in CloudFront (and thus the newer versions have new URLs), I'd recommend setting a *very* long max-age value, such as a year.

Change History (3)

comment:1 Changed 10 years ago by Wiktor Walc

Nice catch! Strangely CloudFront keeps ignoring Customize -> "Object Caching" setting (without any warning) and gets back to "Use Origin Cache Headers" after saving.

In any case, could you check it again now? I invalidated just a subset of all CKEditor files (ckeditor.js + files requested on startup). It looks like they're fine now.

comment:2 Changed 10 years ago by William Gross

I just checked it again, and the files are now being correctly cached. Thank you so much for taking care of this so quickly!

comment:3 Changed 10 years ago by Jakub Ś

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy