Odoo V9 Website Cache Issue - odoo

I have certain custom sales order pages on odoo e-commerce website, which are been loaded based on the templates designed. The page loads dynamic data of sales order stored in the session, but it is either loading old data or not requesting to server and just loading the page from the cache. So to do this I have to manually load the page again by refreshing the page to load the current correct data. This is the problem when I have a domain name assigned for my website, If I access this same website using the IP address it works correctly. So I am not sure what is going wrong here.

Related

issue with multisite SSR transfer state in Sparatcus 3.4

I am using Sparatcus 3.4 upgraded from 2.0.we are using multiple sites(AU and NZ).
problem is when we access any site first (say AU) its giving me the data correctly and everything running fine but when I open the NZ site in the same tab or another tab (which have diff domain but same nginx server) its returning me the AU data. and when I checked the localStorage and sessionStorage for site id and currency its showing me the last website data (ie. AU). and then if I refresh the page its shows me the correct NZ data.
after debugging I found there is issue with the state transfer, maybe server is returning the just last state from server.

Spartacus: Wrong currency code in cart API parameters

We have implemented multisite configuration recently, but facing an issue after it.
When we have it configured (in both mode - Static/Dynamic configuration), we are getting error in cart API when refreshing the page. After analyzing it we found that it is happening due to wrong site context parameter(currency code) and it is happening only in case of non SSR build, when we use SSR it works fine. In case of normal build, it is adding “USD” as currency code in API call with dynamic site binding and if we are using static binding then it is picking the first currency code even if we are on secondary website. Spartacus framework is picking it from default list of currency codes when hitting cart API on page refresh.
Spartacus version:2.0
Screenshot
Error message
Please share a solution on this.
You can add currency in static configuration (e.g. adding currency: ['JPY'], inside context, currency will be JPY).
If your multiple sites using different "currency" (e.g. one site uses "USD" and the other one uses "JPY"), then you cannot use static configuration. Dynamic configuration loads all base sites data, and get the default currency from each site (the value is: the defaultCurrency of the first store in the site). So, you need make sure the site data is set correctly in backend.

Too much / infinite loop issue - Shopify

In Shopify:-
When my for loop code run then this issue occurred:-
"There was a problem loading this website
Try refreshing the page.
If the site still doesn't load, please try again in a few minutes."
console error is
"Failed to load resource: the server responded with a status of 502 ()"
How to fix it.
Seems like your Shopify site has too many collections and products within them so it just fails to load all of them due exceeding memory limits.
I'm assuming that you're trying to replicate the page from the reference URL you provided in your comment. Consider one of the options below to implement the required functionality:
Create different automated collections for each price range using Product price is less than condition. This approach is good as it uses Shopify's engine to generate collections, but it still might be quiet tricky to implement grouping as on the ref site you provided in comments.
Load collections and its products using AJAX requests i.e. request the data only when a customer is scrolling the page down. It will increase page load speed and will slightly decrease the Shopify site load but still is not ideal as data still will be requested on every page load and scrolling down events. You can slightly improve the situation by caching results on the clients' side, but again, is not ideal still.
Create a custom Shopify application that syncs products with your database. Then you can create an URL on your server that will be used as a data provider for your page. It can be requested via AJAX and return JSON with all the products, grouped by collections and matching the request parameters e.g. price less than X.
You can go further and add a proxy extension to your app. Shopify proxy would allow you loading a custom page directly from your server with the data from your database and render it within Shopify site like a part of itself.
In general, this approach gives you more flexibility on data to output, which can also be cached on your side to increase page speed load drastically.
Personally, I would prefer the last option.

Share dynamic content on LinkedIn

I have a JS based CMS that populates a single page with different content based on URL parameters passed to the page. I am using the shareURL format (https://www.linkedin.com/shareArticle?mini=true&url=''&title=''&summary=''&source='')
But the parameters I pass are never used it always falls back to what is being served directly from the server.
Do I have to use the API to make this work and if so can I use the API without making the user authenticate?
Is there a correct way to pass this so that linked in will display the correct data.
After testing this more I realised that the linked ins share URL does not take its parameters it only takes what is served from the server. So I changed my build process not to get the pages in run time but to precompile them onto the server. Maybe in the future linked in will have resolved this for dynamic pages.

How to move html with a tracking pixel to a different server?

There is a web page with tracking pixels (and probably other tracking code) that I would like to move to my own server. Viewing the page on the current server generates a page view as expected, but when I move the html (exactly, without any changes) to my own server, the hits are not registered. I'm trying to understand why - is it possible that the tracking mechanism can determine the IP address of the requesting page?
Thanks for any advice.
If there's an external js file involved in the tracking, you'll need to add that too.