Generate cache key for Cover Photo Url

Bryan Adams Posted in Component Development 4 years ago

Hello, I'm using the OSSN API to get user details in the mobile App I am making.

This is the doc for getting user details: https://www.opensource-socialnetwork.org/webservices/view/3567/user-details

The sample URL of a cover photo: https://app.com/cover/billgates/d1c4824d67578bfe402327b9c29d3b9c.jpg

The problem is that the cover URL redirects you to the home page if you don't have the ossncache query param (i.e. ?ossncache=23acb070)

Is there a way to generate a ossn_cache to be used in a cover photo URL? Thanks!

Replies
gb Kevin B Replied 4 years ago

Not sure if this'll help, but I'd debug the output of the API and check that each of the URLs in the output are correct.

If you disable caching on the site, do you see the same results?

ph Bryan Adams Replied 4 years ago

Okay thanks. I'll inspect it. I'm testing in a test site

Indonesian Arsalan Shah Replied 4 years ago

See my answer below. Right now i am not sure where it is being cached.

ph Bryan Adams Replied 4 years ago

I think there's a cached URL. Is there a hack to fix this? Or will clearing cache fix this? Also I noticed: Do you have to be logged in to access a cover photo? I thought a guid and API key is fine.

Indonesian Arsalan Shah Replied 4 years ago

It didn't need any cache key and you should be able to view sample URL of cover photo. Each time you upload cover the URL of cover changes itself.

So if without cache if it redirects you to home page then that means you have some cached URL, are you trying to test on localhost or production? Do you have any CDN enabled like cloudflare , Imperva?