You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 26, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/guide/cookbook/elastic.md
+14-18Lines changed: 14 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -623,7 +623,14 @@ module.exports = function (restClient) {
623
623
}
624
624
625
625
````
626
-
This library file only deals with _GET_ API to get a list of offline stores from Magento 2.
626
+
This library file only deals with _GET_ API to get a list of offline stores from Magento 2.
627
+
628
+
:::tip NOTE
629
+
```js
630
+
var endpointUrl = util.format('/offline-stores');
631
+
```
632
+
This line is particularly important, since `'/offline-stores'` is where the API url endpoint is determined. It should match the API url endpoint of Magento 2 side.
633
+
:::
627
634
628
635
5. Now we need to include this library in `index.js` :
629
636
```bash
@@ -713,7 +720,7 @@ debug: Response received.
713
720
2020-03-10T09:22:32.140Z - info: No tasks to process. All records processed!
714
721
2020-03-10T09:22:32.140Z - info: Task done! Exiting in 30s...
715
722
```
716
-
:::tip NOTE
723
+
:::warning NOTE
717
724
You should tell the machine the environment variable like this before running the command :
718
725
```bash
719
726
export MAGENTO_URL=http://localhost/rest
@@ -855,16 +862,16 @@ Now you are all set to use custom entity you just created. The next step lets yo
855
862
import { currentStoreView } from '@vue-storefront/core/lib/multistore'
856
863
import { registerModule } from '@vue-storefront/core/lib/modules'
857
864
import { OrderModule } from '@vue-storefront/core/modules/order'
858
-
import { quickSearchByQuery } from '@vue-storefront/core/lib/search';
865
+
import { quickSearchByQuery } from '@vue-storefront/core/lib/search'; // Import the method to fetch data from ES
859
866
860
867
const storeView = currentStoreView()
861
868
862
869
// ... abridged
863
870
864
871
methods: {
865
-
async showPayment () {
866
-
let offlineStores = await quickSearchByQuery({ entityType: 'offline_stores' });
867
-
alert("Your item will be sent from the shop at " + offlineStores.items[0].address);
872
+
async showPayment () { // the method should be done with async/await
873
+
let offlineStores = await quickSearchByQuery({ entityType: 'offline_stores' });
874
+
alert("Your item will be sent from the shop at " + offlineStores.items[0].address);
868
875
const payment = new PaymentRequest(this.paymentMethods, this.paymentDetails , this.paymentOptions)
869
876
870
877
// abridged ...
@@ -875,18 +882,7 @@ Now go to your online shop, put an item to cart and open it, click __Instant Che
### 3. Peep into the kitchen (what happens internally)
892
888
In this recipe, we iterated a whole journey of building custom entities on your online shop (it was Magento 2 for this time) for whatever reason to deal with various information for enhancing your customer experience.
@@ -898,7 +894,7 @@ Second, as an appetizer, we had to import data from shop using _mage2vuestorefro
898
894
Third, main dish, we extended core adapters in `src` folder so we are safe for future updates :).
899
895
It was actually very easy! you just need to `registerEntityType` for your custom entity! We also looked at how to implement it in real example though it was simplified version, you better follow `vuex` best practice.
900
896
901
-
We also have a variety of main dish, by giving you an option to go with _GraphQL_. This approach took us a little more to tweak with, but believe me, _GraphQL_ has pretty good advantage over its competitors.
897
+
We also have a variety of main dish, by giving you an option to go with _GraphQL_. This approach took us a little more to tweak with, but believe me, _GraphQL_ has [pretty good advantage](https://www.altexsoft.com/blog/engineering/graphql-core-features-architecture-pros-and-cons/) over its competitors.
902
898
903
899
Now we can extend our shop as good as it gets to handle more versatile information on your shop. Congratulation!
Copy file name to clipboardExpand all lines: docs/guide/installation/production-setup.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -444,6 +444,14 @@ yarn start
444
444
445
445
Both applications use [`PM2` process manager](https://pm2.keymetrics.io/docs/usage/process-management/) in production mode (`start` commands) to manage and respawn the node.js processes when needed.
446
446
447
+
## Cache Strategies
448
+
449
+
### Varnish cache for VSF
450
+
_Vue Storefront_ has multiple layers of cache, and the forefront cache is _Varnish_ which serves a request just as fast as a static HTML page once it's hit. You can install it from [here](https://github.com/new-fantastic/vsf-cache-varnish).
451
+
452
+
### Vue Storefront Proxy
453
+
_Vue Storefront_ can be set up with [OpenResty](http://openresty.org/en/) based reverse proxy serving cached pages from Redis without Vue StoreFront (VSF or VSF API) calls, using LUA. [Here](https://github.com/ClickAndMortar/docker/tree/master/vue-storefront/proxy) is the github repo.
0 commit comments