• Resolved izzappel

    (@izzappel)


    Hi

    I wonder how static file caching works when plugins are updated.

    Currently the Expires header is set for all static files (CSS, HTML, JS, Images, …). By default, 28 days is suggested.

    Now I am interested in two cases:

    Case 1: JS file is composed via WP Optimize.
    – Filename: …/cache/wpo-minify/…/wpo-minify-footer-…..min.js

    Case 2: JS file comes directly from a plugin and is excluded from JS optimization (still gets the expires header)
    – Filename: …/plugins/…/assets/js/somefile.js

    Now when plugin updates are made, the filenames would need to change to clear the browser cache for the website visitor.

    How does this look like in these two cases?

    – Is the filename of the compound WP-Optimize files dependent on the content?

    – How can I guarantee that the excluded plugin files (case 2) are not outdated after an update?
    Is it possible to exclude these files from static file caching as well? Or is there a way to include the plugin version or a content hash in the file name?
    How must this case be handled?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Venkat Raj

    (@webulous)

    Hi @izzappel

    Case 1: Upon any update, the cache will be purged and cached freshly. The filename depends on the version number which usually changes with update

    Case 2: If your server is configured to use ETag properly, then every time the static file content changes, the ETag also changes. This ensures serving fresh file regardless of expires header. We also use Last-Modified header which also ensures fresh file content.

Viewing 1 replies (of 1 total)

The topic ‘Static file caching’ is closed to new replies.