Search

Mar 28, 2023

How to increase caching time for the third-party script links by using FASTLY config

Question: 

How to increase caching time for the third-party script links by using FASTLY config?

How to setup cache long time for the 3rd scripts? We want increase caching for them?

Do fastly support to do this?


Answer: 

Is it not possible for control caching for third party scripts. Even if those scripts were using Fastly, their TTLs is something that is controlled by the owners.

Maybe some of those scripts can be hosted locally on your website, but it would require you to keep them updated and probably could run into many compatibility issues.

This has been a known issue for a long time because people want to score 100% in PageSpeed: https://stackoverflow.com/questions/29162881/pagespeed-insights-99-100-because-of-google-analytics-how-can-i-cache-ga


is Flat_Products related Elastic search 6? Magento 2.3

A few days ago, we lost all products of KD category. All products of KD Category didn't display on front-end. We think the main reason because of Flat_Products is disabled on admin page. So we enabled the Flat_Product and re-indexed?

We are using Elastic Search 6. If we disable Flat_Products, so do we get any errors? Or do this relative to Elastic Search? 

STEP BY STEP:

1. Disabled Flat_Category and Flat_Products on admin page 

2. Re-index. Site worked fine 

3. Then, the KatieDuke category page didn't display their products. 

4. Enabled Flat_Products on admin page, still disabled Flat_Category 

5. Re-index. Site worked fine. 

6. Until now, we didn't receive the error yet


SOLUTION:

Flat tables are not related to Elasticsearch - furthermore, it is not recommended in 2.3: https://docs.magento.com/m2/ce/user_guide/catalog/catalog-flat.html

Please disable the Flat tables.

We changed the value from m2staging to m2 on staging site. So maybe this is main reason for missing products of KD category on production site. For now we changed the value to m2staging on staging site

Did the above changes affect to ElasticSearch or the missing products (on production and staging sites) ? You shouldn't use the same prefix on Staging and Production since they both share the same Elasticsearch instance - the prefix is used to differentiate the search index used by each site. 

It's probably the reason why the products disappeared.