How to modify cache-control header using Transform Rules

How to modify cache-control header using Transform Rules for static files for non logged in WordPress visitors?

Modify current cache-control to max-age=604800, stale-while-revalidate=604800, stale-if-error=604800, immutable.

Transform Rules operate on the Request Header, and you are looking to modify the Response Header, so (currently) Transform Rules cannot do what you are attempting.

EDIT: Response headers are not available in Transform Rules.

Probably the easiest way to do this is with the APO feature. You should also review this support article.

What is the question still here? @michael’s reply was on point with the easiest method to implement caching on Wordpress.

There is a Worker route, but it’s most definitely more complex.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.