User Tools

Site Tools


new_rotation_faq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
new_rotation_faq [2017/10/16 12:23]
127.0.0.1 external edit
new_rotation_faq [2019/09/13 15:17] (current)
admin [Rotation - Groups shows that I have 10 galleries while Rotation - List thumbs - 20]
Line 1: Line 1:
 ====== New Rotation FAQ ====== ====== New Rotation FAQ ======
 +
 +===== What is mod_rewrite =====
 +
 +mod_rewrite - That's an addon that helps to create nice URLs that do not exist on server. There'​s a mod for nginx and lighttpd as well.
 +
 +Let's let by default you have urls like http://​domain/​gallery/​cool-gallery/​index.html,​ in fact there'​s no such path /​gallery/​cool-gallery/​index.html on server. Mod_rewrite transforms it into http://​domain/​scj/​tube/?​slug=cool-gallery , "​nice"​ URL is for SE and users.
 +
 +.htaccess is a file that sets a list of these rewrite urls for apache. ​
 +
 +
 +I'll try to explain how it works:
 +
 +As I said before there'​s such path as /​gallery/​cool-gallery/​index.html on server. You have to use an url like /​scj/​cgi/​out.php?​url=content&​slug=cool-gallery to see a gallery, and this url doesn'​t look nice. That's why we add a special rule into .htaccess that says how to transform urls 
 +
 +
 +RewriteRule ^gallery/​(.*)/​index.html$ /​scj/​cgi/​out.php?​url=content&​slug=$1
 +
 +That means if URL starts with  gallery/, then we have "​something"​ (.*) upto "/"​ symbol, and then it ends with "/​index.html"​ - we have to transform it into /​scj/​cgi/​out.php?​url=content&​slug=$1 where $1 is something that was in (.*)
 +
 +Inn this example $1 = "​cool-gallery"​. So Apache will transform it into  /​scj/​cgi/​out.php?​url=content&​slug=cool-gallery and you'll see a gallery.
 +
 +You see urls like /​gallery/​cool-gallery/​index.html at your site because you have something like href="/​gallery/<​!--GALLERY_SLUG-->/​index.html in your templates
 +
 +That means that if you'd like to change URLs - you need to change rewrites.
 +
  
 ===== Rotation - Groups shows that I have 10 galleries while Rotation - List thumbs - 20 ===== ===== Rotation - Groups shows that I have 10 galleries while Rotation - List thumbs - 20 =====
Line 57: Line 82:
  
  
 +===== How much memory consumes cache =====
  
 +It 100% depends on your site.
 +
 +We cache ready-made HTML in cache. So let's say your index page is 100k. 
 +Plus you have 100 categories, each category page 100k, and you have 50 pages within category , so that's 100 category * 50 pages * 100k = 500M
 +
 +but a user can see those pages in 3 sort modes so 500 * 3 ..
 +
 +Also let's say you have 100 000 galleries , each page is also 100k. So that's 10gb of html.
 +
 +Of course, HTML gets compressed so it consumes less memory, but you can get an idea.
 +
 +Usually when the cache is full an old record get deleted and a new one - stored in cache. Thus if a surfer requests an old one - we'll have to generate a page again rather then just pull it out of cache.
  
 ===== Cache Engines (New) ===== ===== Cache Engines (New) =====
Line 283: Line 321:
   - % of test places on page (% of places on each page where we test NEW thumbs ) some thumbs might not be in the same order as well    - % of test places on page (% of places on each page where we test NEW thumbs ) some thumbs might not be in the same order as well 
  
 +
 +===== eval()'​d code =====
 +
 +If you see something like "Parse error: some error, in /​some/​path/​scj/​tube/​index.php(0) : eval()'​d code on line 1717" - it means you have an error in php code in your template
 +
 +Check php tags like (<?php vs <?), commas. Or  you can remove your phpcode peace by peace to see what part of code causes the error.
  
 ===== How to import a large cvs ===== ===== How to import a large cvs =====
new_rotation_faq.1508156624.txt.gz ยท Last modified: 2017/10/16 12:23 by 127.0.0.1