I'm using Magento to build our EC site.
And I found our product page is not refreshing when I enable "Full Page Cache".
For example, I do this in the first line:
echo time();
but it always shows the same timestamp no matter how many time I refresh the browser.
(And I already disable the cache function in my browser)
But the funny thing is when I append any parameter to my url,
for example
mysite/?a=0
The timestamp is updated accordingly.
Is this the expected scenario with Magento framework?
Or did I just get something wrong?
Thanks.
That's right!
You need to develop a store without cache function.
At the end you can turn it on. This cache is intended to user
Related
I have a Wordpress website and I notice that my URL is not correct, it generates a weird text ?v=2a4b9e2e4254 for example http://my-domain/?v=2a4b9e2e4254, and this text is appears in every page and post, e.g. http://my-domain/contact/?v=2a4b9e2e4254
Any ideas on how can I fix this? I tried everything on phpMyadmin on wp-config with no result.
The v argument is added by WooCommerce if geolocation with page caching support is enabled:
Geolocate with page caching support is the same as above, but does the geolocation via Ajax. You may notice your website URLs have a ?v=xxxxx appended to them. This is normal to prevent static caching of prices.
As long as you don't need that feature you should be able to disable it in your WooCommerce configuration.
As you know infinite-scroll does repeated ajax request to get new content, and now hits directly Apache because the call is POST, and it has Cookies. We store in the session the last displayed item for each visitor, that's why the session hence the cookies.
We would like to take advantage of Varnish caching, so we are looking to improve this, and we are wondering what are out options here, as we need to do without cookies, without POST (so there is no user real identification).
We store in the session the last displayed item for each visitor
You can pass this information as a query string in the url of the next page. Also try not to use POST for loading a next page, use GET requests.
I have use caching with Infinite scroll based on the example code provided on the github page here the part we specifically need to look at is as follows...
nextSelector: "div.navigation a:first",
navSelector: "div.navigation",
The next 'section' loaded by the infinite scroll is picked up by read a link and getting the page contents.
As far as my knowledge goes, it uses the jQuery Load Feature and that feature states the following...
Request Method
The POST method is used if data is provided as an object; otherwise,
GET is assumed.
Therefore most standard caching techniques should work fine. I hope this helps, although i'm not familiar with varnish this should point you in the right direction.
Following the code above each link picked up by nextselector can contain GET Parameters for dynamic content.
I'm trying to display the main menu from other context using Wayfinder. I have the following call:
[[!Wayfinder#MainMenu? &startId=`0` &contexts=`web` &scheme=`full`]]
The problem is that the first time the page is visited, no menu is displayed. After a refresh it shows up. This happens from time to time.
I'm guessing it's some kind of cache problem but I can't figure out why it doesn't show the first time round.
Setting cacheResults to true or false doesn't seem to affect the issue.
Any help?
Thanks
This answer might come in late but you should try manually deleting the contents of core > cache via ftp or ssh. That usually does the trick when I have issues like that.
i have static pages created on my site for different articles, but problem is that its not dynamic page, means its just created once and its done. so now m worried how to count page views ? i mean when some user visit through search engine :( the count's did not +1 in database it only records count of page views when someone search that particular page and then come. In this way the users visited via search engine is not counted...
so i got one idea...
that we can put some ping php type code which when visited page any how either through google or any where it will be pinged and it will udpated specific table in mysql...
please guide me...if i m right or not... provide me php code for it...thanks
Try to install Google Analytics. This implies you insert some JS code into your page, once at the start. Then, each time user opens the page (and doesn't have his JS disabled, which is most probable case) JS fires up and make some secret request to GA, recording this visit.
Once upon a time I've seen a trick to augment TRULY static pages with GA counter, through some PHP preprocessor hooked via .htaccess, like this: Action text/html /cgi-bin/add_ga.php. This involved parsing HTML and inserting a couple of <script> tags into the header, and then serving page to the visitor. Entire directory of static pages, updated independently with any frequency, was hooked to GA this way.
I have a pretty strage problem im dealing with.
Lost sessionvariables in firefox.
Im using wordpress and have a subpage that causes the loss.
More specific:
In wordpress there exists a page called My pages (Original page names are in swedish, translated for convinience)
Under this page i have a few subpages. Among these are a page called Create test. There is nothing special about this page, for now only contains the phrase "hello world". If I enter any page other that this, it works.
But this particular page just seems to clear my session variables (wich I use to store login info)
I tried deleting the page in question in the effort to remake it.
While it was deleted I tried navigating around on the page.
Create test was the last item in the subnavigation menu, and now when its gone, the same thing happens on the last menuitem (now Account settings). This leave me to believe its something with the menu.
Even more strange, after recreating Create test, so that this page is now the last item. Still it's Account settings that is the page with the resetting of sessionvars...
I have through echo determined that the session id stays the same, just the variables that get unset.
I have unset($_SESSION['id']); at only one place, and this code is NOT run.
The problem just baffles me and I have no idea why this particular pages does this.
It may be totally unrelated, but we had problem with Firefox and sessions on certain pages in the past. It happened most of the times while developing and therefore refreshing a particular page, have you tried clearing your browser cookies which is where session is stored?
As an addition:
Check that you assign sessions before you write anything to the response stream.
Also we had similar problems with sessions set in a pages that were doing a redirection (i.e. a login page that if successful would set the session and redirect to the another page.)
I'm not sure about PHP but in .NET that can be overcome by explicitly setting not to terminate the response so that all headers are written to the response stream.
Fixed now, actually have no idea what I did. but I've change some html but mostly CSS.
So there is a strong posibility it was CSS-related.