Code Monkey home page Code Monkey logo

cachelite's People

Contributors

andrewminton avatar brendo avatar chobohub avatar gator92 avatar jensscherbl avatar makenosound avatar nickdunn avatar nitriques avatar simoneeconomo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cachelite's Issues

Rule not matching

I have an excluded page like

contact/*

However, this url won't be excluded from caching:

site.com/contact/city

Line 458 should be changed from this:

elseif(substr($r, -1) == '*' && strncasecmp($path, $r, strlen($r) - 1) == 0) {

to this

elseif(substr($r, -1) == '*' && strncasecmp($path, $r, strlen($r) - 2) == 0) {

Notice the -2 value (previously -1).

Cachelite with one page

So I am trying to implement Cachelite on a site with all Datasources feeding into a single page. I have Symphony sections to handle different URLs and code that routes datasources and Conditionalizer turns them on for different URLs but there is only one base page in Symphony. How can I integrate Cachelite with my site? Will it know that all my datasources feed into a single page?

When I have tried using it in the past, upon saving entries in my sections it would not flush cache and I ended up having to abandon using it. Any ideas or pointers?

2.4 woes

Symphony Warning: DOMDocument::loadXML() expects parameter 1 to be string, object given
An error occurred in
/Applications/XAMPP/xamppfiles/htdocs/sym24/extensions/cachelite/extension.driver.php around    line 353
         }
    }

    # Parse any Event or Section elements from the page XML
     public function parse_page_data($context) {
         $xml = DomDocument::loadXML($context['xml']);
         $xpath = new DOMXPath($xml);

        $sections_xpath = $xpath->query('//section[@id and @handle]');
         $sections = array();`

Seems to be throwing a wobbly on 2.4RC2 probably lower versions too.

Unstyled snapshot

I'm pretty sure this is due to the Cachelite plugin, but I'm happy to be corrected.

I've installed it on a site we've just launched (stubbingtonark.org.uk) and on two occasions I've had reports of users seeing a completely unstyled page, which I've been able to confirm by visiting on a separate machine. Flushing the cache for the page fixes the issue.

I suspect that what's happening is that if the page is rendered and cached without the stylesheet (for what reason I don't know) then the cache will serve that unstyled page until it expires.

Is this something that anyone has seen before? Is there an obvious reason why an unstyled page could get cached?

Unfortunately it doesn't happen enough to be able to easily monitor it - it's only happened twice since installation yesterday out of many visits.

Symphony Warning: DOMDocument::loadXML(): AttValue: " or ' expected in Entity, line: 1

Symphony Warning: DOMDocument::loadXML(): AttValue: " or ' expected in Entity, line: 1
An error occurred in /data/sites/web/thesite/www/extensions/cachelite/extension.driver.php around line 361
356
357 }
358
359 # Parse any Event or Section elements from the page XML
360 public function parse_page_data($context) {
361 $xml = DomDocument::loadXML($context['xml']->generate());
362 $xpath = new DOMXPath($xml);
363
364 $sections_xpath = $xpath->query('//section[@id and @handle]');
365 $sections = array();
Backtrace
[:0]
GenericErrorHandler::handler();
[/data/sites/web/thesite/www/extensions/cachelite/extension.driver.php:361]
DOMDocument->loadXML();
[/data/sites/web/thesite/www/symphony/lib/toolkit/class.extensionmanager.php:706]
extension_cachelite->parse_page_data();
[/data/sites/web/thesite/www/symphony/lib/toolkit/class.frontendpage.php:213]
ExtensionManager::notifyMembers();
[/data/sites/web/thesite/www/symphony/lib/core/class.frontend.php:106]
FrontendPage->generate();
[/data/sites/web/thesite/www/symphony/lib/boot/func.utilities.php:232]
Frontend->display();
[/data/sites/web/thesite/www/symphony/lib/boot/func.utilities.php:212]
symphony_launcher();
[/data/sites/web/thesite/www/index.php:17]
symphony();

[0.0007] SELECT SQL_CACHE id,handle,parent,plh_t-en,plh_h-en,plh_t-pt,plh_h-pt FROM sym_pages AS p WHERE 1 ORDER BY sortorder ASC;
[0.0006] SELECT SQL_NO_CACHE * FROM sym_cache WHERE hash = 'c2b44b440e21f24b96dca4168653316d' AND (expiry IS NULL OR UNIX_TIMESTAMP() <= expiry) LIMIT 1;
[0.0005] SELECT SQL_NO_CACHE * FROM sym_cache WHERE hash = 'c2b44b440e21f24b96dca4168653316d' AND (expiry IS NULL OR UNIX_TIMESTAMP() <= expiry) LIMIT 1;
[0.0021] SELECT SQL_NO_CACHE * FROM sym_cache WHERE hash = 'c2b44b440e21f24b96dca4168653316d' AND (expiry IS NULL OR UNIX_TIMESTAMP() <= expiry) LIMIT 1;
[0.0014] SELECT SQL_NO_CACHE * FROM sym_cache WHERE hash = 'c2b44b440e21f24b96dca4168653316d' AND (expiry IS NULL OR UNIX_TIMESTAMP() <= expiry) LIMIT 1;

Update 1.3.3 -> 2.0.0 error Invalid default value for 'timestamp'

MySQL Error (1067): Invalid default value for 'timestamp' in query: CREATE TABLE sym_cachelite_references ( page char(128) NOT NULL, section_id int(11) NOT NULL default 0, entry_id int(11) NOT NULL default 0, timestamp datetime NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY (page, section_id, entry_id), KEY page (page), KEY section_page (page, section_id), KEY entry_page (page, entry_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

Not caching when logged in

It took me ages to figure out that caching never happens when you're logged in. This makes perfect sense for development, but it confused me as I was trying to verify that caching was working! Could it be added to the README?

In other news — should it be that the cache can be flushed even when not logged in? A potential vulnerability is that someone could repeatedly flush the site cache with a script, negating the caching altogether :-P

Doesn't include changes performed by the "HTML5 Doctype" extension.

Just noticed that the cachelite extension doesn't seem to reflect the changes that the html5-doctype-extension performs.

As long as I am logged into symphony I am served valid html5-code, as soon as I log out cachelite seems to intercept the page output before html5-doctype performs its manipulations and therefore serves me the basic symphony xhtml-doctypes.

My Setup:

  • Symphony 2.5.2
  • Cachelite 1.3
  • HTML5 Doctype 1.3.2

Varchar(255) is not enough

We should consider to

  1. Change varchar(255) to text
  2. Or create multiple records

I do not understand the rationale behind the move of the bug strings of ids...

Maintenance mode should expire cached pages?

Should putting the site into maintenance mode expire caches? I went to test my maintenance page today and wondered for a minute why it wasn't showing on some pages. Temporarily setting the cache time to 0 seconds or disabling the extension are both reasonable workarounds.

Question: fragment caching

Max, how complex would it be to add an additional layer of complexity to this to cover fragment caching as well?

On several of our sites we have a dynamic header/footer, which reflect a logged-in state (“Hi Nick | Log out”) which prevents us caching the entire page. I wonder whether it would be possible to add an additional feature so that one may choose the XPath/selector to an HTML element to cache? For example I might want to just cache the entire page (“html”), but I may just want to cache the main content column (div[@id=‘content’]).

Do you think this would be useful?

We have a DS caching concept on the way (both a core change and an extension) but I think this might be a powerful way of selectively caching a page.

Cachelite problem with frontend

We use Symphony 2.61 and cachelite 1.3.
We use a frontend cms, which is loaded after logging in.
When we are logged in (/data/logged-in-author/author) then there is no caching and everything works perfect.
The problem raises after logging out (post to symphony/logout/), we still get the frontend cms loaded on some pages.. so we need to login again and flush=site in order to have the cache recreated..

Everything works perfect without the cachelite extension, but we really need caching.
Problem happens on localhost and on server, in the logs i see:
[Tue Mar 31 18:06:53.091130 2015] [proxy_fcgi:error] [pid 11550:tid 139803965888256] [client 85.247.208.69:58574] AH01070: Error parsing script headers

It's like if the pages with the if $author to load the cms have this part of the code cached,
but no caching comment.. and when logged in, there is no caching of course.
It's like if after logging out, the page cache is not recreated.. cannot be recreated..

Thank you

Excluded url's not working 100%

We have tried to exclude our cms but doesn't seem to work 100%.. (we are not logged on to symphony). We need to disable caching when a member is logged in..
Would it be possible to have some more info about the excluded pages in combination with the languages extensions?

if we just add home it works for the home page not to be cached, but for cms this doesn't work, cms has several subpages.. tried cms* cms_* /en/cms*

Thanks

Can't directly access Page::$_headers as of Symphony 2.0.5

Unfortunately 2.0.5 has made Page::$_headers protected, meaning it cannot be directly accessed via

$headers = $page['page']->_headers;

The other unfortunate thing is there is no other way to access the header array.

To remedy this, I have added a public accessor method to the Page class. See the commit here. This will make it's way into the 2.0.6 update.

CacheLite prevents viewing ?debug

I don't seem to be able to view the ?debug screen on a 2.5 site when this extension is enabled. Naturally I'm logged at the time.

Disabling it allows me to view the debug fine.

Possible "duplicates" errors

I came across a bug in a production website. Some pages have a lot of query strings, and the length of 255 chars on the page column is not enough.

I quickly fixed it using ON DUPLICATE KEY UPDATE, but I feel that this is more of a hack then anything else.

I do not think that this is a good key. I really think that we should MD5 (or SHA-X) the serialized $_GET in order to be sure that we are dealing with a fixed length thingny.


I really like this extension BTW. Would adding APC and/or memcached as alternate storage would be useful to anyone ?

Members extension with frontend CMS

We use the members extension to add an extra admin toolbar on the website, but this extra admin functionality also gets cached.

We suggest to add also check if the member is logged (don't cache) in or not (caching)

Update Cache_Lite version

Before I look into doing it and giving it a shot, has anyone attempted to update to the latest Cache_Lite library? The latest release was November 2019 but the extension is using a version from 2011.

2.4/2.5 Compatibility

Where is this extension at in being compatible with Symphony 2.4 and Symphony 2.5.

Cache Period doesn't work at all

The method _cleanDir($dir, $group = false, $mode = 'ingroup'){ ... } never get called.

It starts with $_automaticCleaningFactor = 0

starthere

Then when you go in the method save(..) {...}

tohere

And nowhere in the extension folders, $_automaticCleaningFactor isn't increment to 1 or modify.

The method simply skip the $this->clean(false, 'old'); and never call it,
since $_automaticCleaningFactor = 0.

Here some screenshots of the save, clean and _cleanDir methods.

savemethod

cleanmethod

_cleandir

Can't flush cache

?flush=site Doesn't seem to be actually clearing the cache for me, just bypassing it. So when I run it it initially looks like it's worked, but subsequent visits show that it hasn't (I have confirmed this isn't due to local caching issues).

The only way I've found to clear the cache is manually deleting the files.

Bit of a ball ache!

Does not respect the protocol

It should create a separate cache when the request is made over TLS or not. Right now, this causes mix-content warnings.

Conflict between Cachelite and URL Router

There's a conflict between Cachelite and URL Router.

On line 19 in extension.driver.php you're caching the GET array.

On line 441 you're using the symphony-page variable from the cached GET array to determine if the page should be excluded or not from cache. However, in case of a setup using the URL Router extension, most probably this variable will not match the actual page path because of re-routing, thus resulting a false negative.

I suggest Cachelite should subscribe to FrontendPrePageResolve delegate and after URL Router fired it's callback, Cachelite should use the page path generated by URL Router for further processing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.