My module needs to generate unique HTML output for each request, it has been working fine with a read from `request.cookies` which busts page cache, until a few weeks ago. Now the pages only generate new HTML when query string is changed. I have tried following tricks without success:
* {{ request.cookies.x }}
* {{ request.geoip_city }}
* {{ request.headers.*** }}
* {{ request.contact.email }}
* {{ local_dt }}
(and some others that I may not remember)
Is there any other way I can use to ensure the page is not cached? Thanks! FWIW my portal ID is 575821.
Hey @JHu , what is it your module actually doing that the HTML is not being refreshed each request?
We'd rather you not resort to tricks to trigger caching to not work, and just make the end result work, or propose a better practice.
If you can share your Design Manager link to your module that would be really helpful. Please send that either as a DM on the community here, or if you're in the developer slack, DM it to `@jon mclaren` (that's me). I likely will respond faster if sent by Slack but it's your preference.
Not to drop into this old post, but I think my post is best fit here rather than another new one. I find this one of the most annoying parts of deploying to Hubspot (Otherwise it's pretty ok). I have several clients of I have created sites for, and when debugging and updating small design issues, sometimes those changes don't show up. Sometimes, I wait overnight and the issues are still there. I have to constantly second guess if I am editing the wrong file and such. Ideally, I could see cache on by default, and an option if hs watch that could disable cache while hs watch is on (or times out after a few minutes).
@jmclarenThanks for your reply, the module is at https://app.hubspot.com/design-manager/575821/modules/28948434330 and you can test it at https://offers.techimpact.org/training/google-analytics . We are generating an one-time token as security measure for calling a custom integration, the token contains timestamp and supposed to change on each request, and a signature generated in HubL. The timestamp is there to avoid the token being reused, and since it is signed it is not possible to change it on client side.
If you go to the variables doc and do a search for Use of this variable will disable page caching, you should see all variables that should break a page's cache.