AMP Script Not Working on Google AMP Cache (ampproject.org) - vue.js

We have a very strange problem. Here's for starters.
AMP Page in Question: https://justbang.com/amp/ (valid + functions correctly upon clicking yellow button in hero section to show modal / signup process)
Google Cache of AMP Page: https://justbang-com.cdn.ampproject.org/c/s/justbang.com/amp/index.html --> (valid BUT DOES NOT function correctly upon clicking yellow button in hero section to show modal / signup process - AMP script fails.
Upon downloading the page source for https://justbang-com.cdn.ampproject.org/c/s/justbang.com/amp/index.html and saving it + running it on local host, it functions 100% properly (clicking yellow button results in modal showing proper content). We uploaded the same source on https://justbang-com.cdn.ampproject.org/c/s/justbang.com/amp/index.html to the following file on our server https://justbang.com/amp/current-google-cache.html - which also functions correctly.
So for some reason this source in question:
1. executes properly on localhost
2. executes properly on our server
3. does not execute properly when hosted on ...amprpoject.org...
Any information is greatly appreciated. Thank you for your time.

Related

Caching Issue with App Within Minutes sheet pages

I have created simple AppWithinMinutes application and I added following velocity code at the end in “sheet” page just before the html tag ends:
<div>
#set ($title = $doc.title)
## OR #set ($title = $doc.name), depending if your pages have titles
#set ($newTitle = $title.substring(0,6) + "X" + $title.substring(7, $title.length()))
<h2>Applications with a tag: $newTitle</h2>
{{PagesByTag tagName=$newTitle}}{{/PagesByTag}}
</div>
PagesByTag is a macro that I created to list all pages that contains the tag of a new title that I calculated.
Problem is:
I have a page called “My Application” with a tag “SERVERX01”
I have created a page in my AppWithinMinutes called “SERVERD01”. So now when I visit page SERVERD01, it displays “My Application” and that is desirable behavior (when you hard refresh it, disappears… hard refresh again brings it back… So it seems to be a cache issue…)
Now when I create a page in AppWithinMinutes called “MYAAPPD21”. Now “My Application” shows up here as well… This is not expected since $newTitle now will be “MYAAPPX21” and there is no page with that tag… (Hard refresh to that page will make “My Application” disappear but now when I visit “SERVERD01” page, “My Application” is gone from there as well)
There seems to be a serious caching issue with “sheet” page. Can someone tell me how can I disable caching for AppWithinMinutes display (sheet) pages?
Thanks a lot
I found a solution. In case someone like me facing exact same issue.
There wasn't an issue with App Within Minutes. It was a macro I created PagesByTag It has cached property set to yes. That was causing tag result on the sheet page to cache and was displaying undesirable results.

Pinterest share button with Gridsome (vuejs)

i'm trying to add Pinterest share button on my page template. I've followed the guidelines of Pinterest by adding the script before the tag, and the right link in my page.
Both in development or production mode, the button is correctly updated by the script. But when i change page, and load another post, the button remains as "default", not updated.
working version (at first page load) :
Non working version when I change page :
Pinterest script is (i think) loaded the way they ask on their website (before tag) :
and this is how i load it in metaInfo() :
i've tried everything, dynamically create script tag in mount cycle, with or without the button
i'm always facing this one shot working button, and i can't figure out why
the only strange thing i can see, is that i have this script in : https://assets.pinterest.com/js/pinit_main.js?0.8287268902280864
script that i do not call in my template
but it's also present when the button is working
any help will be appreciated ;)
thanks

Page not updating when hitting back button, after submitting form in POST request

I have a simple test web site with 2 different pages, Page1 and Page2. Pages are generated by a web server.
All responses contain these headers:
Cache-control: no-cache, no-store, must-revalidate
Pragma: no-cache
Page1 contains a link to Page2 and a TextArea element, enclosed in a FORM tag. Page2 is a blank page (it doesn't contain anything useful).
Clicking on the Page2 link (inside Page1) will submit the form (and TextArea value) to the server and switch to Page2.
Each time Page1 is requested from the server, a new line is added to the TextArea. This happens at server-side (no DOM manipulation via JavaScript, at browser side).
So, when application starts, Page1's TextArea contains:
"Line 1"
If I click on the link to Page2 and then hit the back button, Page1's TextArea now contains 2 lines, as expected:
"Line 1"
"Line 2"
This shows 2 things:
BFCache (Back-Forward cache) is not being used (because each time the back button is hit, a new request is sent to the web server). It can also be confirmed by the fact that pageshow's event parameter persisted property is false.
The browser is updating the page correctly (because new content added to the page, at server-side, is being shown at browser side, as expected)
However, if I clear the text area, click on the same link to Page2 and then hit the back button, the TextArea will still show an empty content. I would expect it to show exactly one line of text (inserted by the server). This happens in all tested browsers, including WebKit, FireFox and even Internet Explorer.
Using Network tab from Developer Tools I can see that the server responds with the correct content and the preview sub-tab (in dev tools/network) shows exactly that.
So, in the second scenario, the browser is definitely retrieving the updated content from server, but refuses to update the page with that content. Seems to me that whenever the page is submitted, the browser will use the submitted page when the user hits the back button, regardless of content updated at server-side.
This issue is very similar to another here: How to prevent content being displayed from Back-Forward cache in Firefox?
with same symptoms but in that case there is no form submit and change in response headers would fix it.
My questions:
a) Why browsers retrieve an updated content from the server but don't use it to update the page in that particular scenario? Is it a documented behavior?
b) Is there a way to change this behavior? I'm particularly thinking about a way to force the browser to update the page with the response from the server (the same way it occurs when no submitting is involved).
BTW, submitting the form in an AJAX request is not a solution but merely a workaround for this issue, having in mind that a full post back may be needed in some scenarios.

Zabbix web scenario authentication

So i'm trying to set up zabbix web scenario to monitor webpage up/down. Ive found a way googeling which should work for me, however there is an issue in the login page. I need to be able to press TAB 4 times and then end it with a space to reach the login information panel. But i can not figure out how to tell zabbix to insert TABs or Spaces on the page before it attempts to login.
by default SMART-ID is our main authentication, and the order can not be changed as it would interfere with our user welfare policies. So i need to make zabbix able to navigate to the "Parool" tab for login. Also using the tab key on the page visualy does nothing untill you press the space bar, only after space bar it actually shows you where you have navigated.
So far i have tried to simply add tab and space in the "post fields" section however this does not do anything and i have not managed to google the information i require.
That's not how Zabbix Scenarios works.
Zabbix uses libCurl to check web endpoints, not a browser: you can't render javascript nor post/click to forms (ie: like Python Splinter does).
You can post data to specific web endpoints, like http://somewhere/test.php?id=2345&userid={BLABLABLA} then grab the output and/or the resulting http return code.
Please refer to the documentation for a complete overview.

Timeline app appears only if page is currently liked

This is the first Facebook App i've created since the Timeline changes. Everything appears to be working the same, except for adding the app to my page's Timeline "Favorites"(?) (the boxes at the top near the About section). A large majority of the traffic to this app will come from visitors seeing the app tab on our page.
I'm attempting to add it using the following URL:
http://www.facebook.com/dialog/pagetab?app_id=MYAPPID&redirect_uri=MYAPPURL
Then I select the page, and click "Add Page Tab".
This works fine - I can then swap it's position, view the app, edit settings, etc.
I set up the tab how I want it, and then log out and visit my Facebook Page directly to view the app tab as a visitor would. The app is no longer there. Log back in, everything is fine, log back out, it's gone. It appears that if you do not already Like the page, you cannot see the app. If you do like the page, you can see it. I'd like the app to be viewable by people who do not like the page as well, as the app has a fan gate of it's own.
I've disabled Sandbox mode as well so i'm not sure what's left to do.
Any help is appreciated.
You mentioned in the comments that the app is restricted to US users:
Because your app is restricted, it won't be displayed to logged-out browsers - this is expected because unless the user is logged-in, their location and age can't be determined in order to check the restrictions you've set
If you must have the app visible to logged-out users, remove the API-level restriction and use the details passed in the signed_request to show or hide the app's content
{edit} I missed the edit to your question {/edit} - it may also be that your existing signed_request processing code is failing for logged out users