CRM Extension - Card content is not updated

crm_extensions

#1

Hi there,
I started using the CRM Extension API that I think is a really good thing to have!

I got my first app working nicely but I have one major issue: The result of the call to the URI getting the content of the card is cached.
The data that I want to display in the card is outside HubSpot and will change frequently.
When I reload a contact page that holds a card, the data in this card does not refresh. The URI does not get called because it is probably cached by my browser, thus not updating the content of the card.

I have tried to include properties like “lastmodifieddate” to the call, and when I change any property value in the contact and then refresh the contact page, the content gets updated. But if nothing happened in HubSpot and I load back the page, the content is not up to date. It still matches the data that was returned in the last call.

Is there a way to force the URI not to be cached?
Would there be for example a way for me to append a random parameter to the URI?

Thanks a lot for your help!


#2

Hi @Carlito

HubSpot doesn’t cache any of the data that it would get from the data fetch request, so the card should always have the current data from the fetch endpoint. Also, the request to the fetch API is made separately from the call that would actually be returned to the user’s browser, so the actual fetch request being made to your system wouldn’t directly affect the request made by the browser.

Are you seeing any other data from the contact being cached in this way? There isn’t any special caching on the data for the card compared to the other data being pulled for the contact, so I wouldn’t expect the card data to be cached unless you’re also seeing the rest of the contact data being cached as well.


#3

Thanks Dadams,
I do not see any other data from the usual cards (About, Transactions, Documents, etc.) that is cached.
Only the data from the card I created with my app using the CRM extension does not update properly.

Here’s a very simple use case:
A custom card should display the current time. My app just returns 1 sales object with the current time in a custom Property.
The first time I load a contact, the current time shows up in my card. If I reload the page, the time does not get updated. It still shows the value displayed the first time.

If I clear my browser cache, and reload the page, the time is still not updated.

Now, let’s assume I had decided to pass a custom contact property to the App fetch endpoint. If I change the value of this contact property and reload the contact page, the time gets updated.

So there is some kind of cache going on, that is not my browser.

I understand from your message that HubSpot is not caching the data, and it’s not the browser either, so I’m going to dig some more into that…
Thanks for your help,


#4

I got it… It’s my server that is caching the response to the data fetch URI.

Would it be possible for HubSpot to add a no-cache in the fetch request to avoid that?

It would certainly be useful to me and perhaps other people that are having their own apps.

Thanks again for your help!