[bd] Cache [Deleted]

Where are static files stored. Also CSS to file where does this store everything I wonder if I have stuff left over.
 
I am trying to figure out a hugely annoying issue on my forum. Members are reporting no reply or post boxes to type in as well as other issues like upload buttons not showing etc.
This is even on the default theme. I removed this add-on recently and wonder if it's left anything behind. It seems to be js and cache related. So if anyone can help it would be a massive help.
 
@xfrocks Is there a specific content template used on AMP pages, or some variable passed to the template that we can use to display a different set of advertisements on AMP pages?
 
@xfrocks Is there a specific content template used on AMP pages, or some variable passed to the template that we can use to display a different set of advertisements on AMP pages?
You can edit bdcache_amp_thread_view and add the advertisements.

then it looks like this
Code:
<xen:container var="$containerTemplate">bdcache_amp_PAGE_CONTAINER</xen:container>
<div align="center">
<amp-ad width=320 height=50
      type="adsense"
      data-ad-client="ca-pub-2342938126547092"
      data-ad-slot="3406133228">
 </amp-ad>
</div>
<xen:include template="thread_view" />
<div align="center">
<amp-ad width=320 height=50
      type="adsense"
      data-ad-client="ca-pub-2342938126547092"
      data-ad-slot="3406133228">
 </amp-ad>
</div>

But you also have to include the script in the header
https://www.ampproject.org/docs/reference/components/amp-ad
 
@xfrocks Is there a specific content template used on AMP pages, or some variable passed to the template that we can use to display a different set of advertisements on AMP pages?
The container template is "bdcache_amp_PAGE_CONTAINER" (instead of the normal "PAGE_CONTAINER"). Both the container template and the content template will have a variable named "bdCache_isAmp".
 
You can edit bdcache_amp_thread_view and add the advertisements.

then it looks like this
Code:
<xen:container var="$containerTemplate">bdcache_amp_PAGE_CONTAINER</xen:container>
<div align="center">
<amp-ad width=320 height=50
      type="adsense"
      data-ad-client="ca-pub-2342938126547092"
      data-ad-slot="3406133228">
 </amp-ad>
</div>
<xen:include template="thread_view" />
<div align="center">
<amp-ad width=320 height=50
      type="adsense"
      data-ad-client="ca-pub-2342938126547092"
      data-ad-slot="3406133228">
 </amp-ad>
</div>

But you also have to include the script in the header
https://www.ampproject.org/docs/reference/components/amp-ad
The best way to include components is below:

Code:
<xen:callback class="bdCache_Helper_Amp"
   method="renderCustomElementScript"
   params="{xen:array 'element=ad',
   'date=201610261016'}"><script async custom-element="amp-ad"<xen:comment>
   </xen:comment> src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
</xen:callback>

The add-on will look for the latest version for each declared element and include the script when render.
 
Using latest version, I don't have this issue.

i have this error with latest bd-cache and 7.1 php

Template Errors: PAGE_CONTAINER
  1. Function mcrypt_encrypt() is deprecated in ***/library/bdCache/Crypt.php, line 44:
    43:
    44: <noscript><style>.JsOnly, .jsOnly { display: none !important; }</style></noscript>
    45: <link rel="stylesheet" href="css.php?css=xenforo,form,public&amp;style=' . urlencode($_styleId) . '&amp;dir=' . htmlspecialchars($visitorLanguage['text_direction'], ENT_QUOTES, 'UTF-8') . '&amp;d=' . htmlspecialchars($visitorStyle['last_modified_date'], ENT_QUOTES, 'UTF-8') . '" />
it's happen when i use "$config['debug'] = true;"
 
Google Search Console is giving me a lot of errors and it seems like it doesn't index most of the AMP pages because of the errors.

Screen Shot 2016-11-16 at 2.19.55 pm.webp
 
Please pick one url for each error and send me here or via convo. Thanks.
I started a PC with you. It looks like it's not rendering the AMP pages anymore.

Edit : Narrowed it down to Tag Essentials, trying to get this fixed. Working with xfrocks and Stuart on the conflict.
Edit: fixed now in Tag Essentials 1.8.4
 
Last edited:
Feature Request:
  • Generates static html files from our dynamic forum pages? Specially forum home, forum nodes, and threads.

Some examples for Wordpress are:
https://wordpress.org/plugins/wp-super-cache/
https://wordpress.org/plugins/cache-enabler/

Both just need custom rewrite (apache .htaccess and nginx .conf) rules for it to work.
This is great for busy forums to save PHP, Mysql, Memcached/Redis Data Caching load.
And also to combat common Layer 7 attacks, that most likely will crash PHP or the Database Service.
 
  • Like
Reactions: Naz
I also have a good idea.

BD cache could use service workers to cache content on the client side, so it doesn't depend on the network. (That way it will even work offline or on Lie-Fi)
first check local cache and show content instantly, then the network and update the content.

This would give users a massive speed boost when it's build the right way.
I'm looking into it at the moment to do it myself. But my brain hurts :D:p;) I have to upgrade it first.
I wouldn't mind paying for it.
I'm looking into building a Progressive Web App
https://developers.google.com/web/progressive-web-apps/
https://www.youtube.com/playlist?list=PLNYkxOF6rcIAWWNR_Q6eLPhsyx6VvYjVb
 
@xfrocks it appears that when you are on an AMP page the template_create event is never fired, or at least it doesn't seem to be in my test environment. Works fine on non-AMP pages, however
 
I'm very impresed by the speed of page load using your caching addon, @xfrocks . However, I have one small issue. When I activate "defer javascript" my js files are placed before the closing body tag.

Unfortunately google page speed still complains the js files block page rendering. As far as I can see it is also necessary to add a "defer" attribute for every js file to satisfy google.

Like this:
Code:
<script defer src="/myjsfile_1.js"></script>
<script defer src="/myjsfile_2.js"></script>
<script defer src="/myjsfile_3.js"></script>
Any plans to add this? Or can I modify scripts myself?
 
Top Bottom