Can I enable RocketLoader when the domain uses a Worker?

We are using a worker to redirect the request (transparent proxy) to a different origin if the user is on mobile (based on user-agent).

When I try to use a PageRule to enable rocket loader, it doesn’t work at all. Workflow is as follows:

  • User requests https://ca.example.com/ from mobile
  • Worker checks if the user is on mobile
    • If it is, then sets origin server to https://ca.mobile.example.com/ and proceeds to fetch the content from there.
    • If it is not, then requests goes through as normal (origin = ca.example.com)

What I want, is the above, but with rocket loader.

Please show us the screenshot of your page rule. And, do you put the more specific page rule at the top?

Yes, I put this rule at the top (#1 rule). It is a pretty simple page rule:

Both https://ca.example.com/ and https://ca.mobile.example.com/ not working?

Do you have the same page rule for https://ca.mobile.example.com/*?

Yes, If i access ca.mobile.example.com directly, rocket loader works perfectly.